Segment Class Reference

Overview

Segment instances track the meta data for a single rule execution (also known as a job). The attributes of a Segment identify:

  • Wether the Segment has been built yet or not
  • What time period the Segment is comprised of
  • Where the output data from the execution is stored or will be stored
  • What other Segments must be built first before this Segment can be built

Segments are generally not instantiated directly. They are either created automatically by DataStores which use them to represent the data that already exists or they are created by rules which use them to represent data that will exist or has been built.

Tasks

Initializing a Class

Segment

Class Methods

Creates a new segment.

Instance Attributes

built

Boolean indicating whether the Segment has been built or not yet

dependencies

A list of Segments that must be built before in order for this Segment to be built. Note that the output urls from the dependencies serve as the input for the given segment.

end

A datetime object representing the end of the time range the Segment covers

error_count

The number of failed attempts to build the Segment

id

Unique identifier for the given Segment

rule

The rule associated with the given Segment

start

A datetime object representing the start of the time range the Segment covers

urls

A list of strings representing the output the Segment will create when the build is complete.