Class - mitto.iov2.steps.builtin.MaxTimestamp
¶
JSON Schema¶
MaxTimestamp¶
Obtain the maximum value of a timestamp column from the output databse. Place the value, known as the timestamp, in the job’s execution environment so that subsequent steps in the job can later reference the timestamp value. Most often used in conjunction with SetUpdatedAt in upsert jobs. Timestamp values may be int, float, and Decimal Python types. These are useful in conjunction with a column that autoincrements as rows are added to a table. The timestamp’s value is placed in the job’s environment as-is (e.g., as a Python int). Timestamp values may also be a datetime.datetime Python type. Python datetime objects are classified as either aware (tz-aware) or naive (tz-unaware), depending upon whether or not they include timezone information. Such timestamp values are formatted as a string using datetime.isoformat() and the string is placed in the job’s environment. For more inforation on timezones, see: https://docs.python.org/3/library/datetime.html#aware-and-naive-objects TIMEZONE MANIPULATION MaxTimestamp provides parameters that can be used when modifying a timestamp’s timezone to make the value compatible with your use-case. Timezones can be manipulated in the following ways:
|
||
type |
object |
|
properties |
||
|
Environ |
|
The job’s runtime execution environment. Do not provide this value in a job config; it is automatically provided by Runner. |
||
|
Logger |
|
The Runner logger to use for log messages. Do not provide this value in a job config; it is automatically provided by Runner. |
||
|
Column |
|
Name of column containing the timesamp values to query. |
||
type |
string |
|
|
Delta |
|
A time delta to be subtracted from the timestamp that is obtained from the table. The value is a dict which is passed as parameters to the Python datetime.timedelta function. |
||
type |
object |
|
examples |
{“days”: 1} |
|
{“hours”: -10, “minutes”: -30} |
||
|
Tablename |
|
The table containing the timestamp column to query. Defaults to the tablename in the job’s execution environment, which is usually defined in the dbo of the job’s output step. |
||
type |
string |
|
|
Schema |
|
The schema containing the table to query. Defaults to the schema defined in the dbo of the output step. |
||
type |
string |
|
|
Params |
|
Dict containing additional criteria that will be applied to limit records queried for the timestamp. |
||
type |
object |
|
examples |
{“region”: “USA”} |
|
default |
||
|
Tz Default |
|
The timezone applied to a tz-unaware timestamp. Unused if timestamp is already tz-aware. The string value must be one of the IANA timezones provided by the Python zoneinfo package. https://docs.python.org/3/library/zoneinfo.html If an invalid timezone is provided, ‘UTC’ will be used instead. |
||
type |
string |
|
examples |
“America/Chicago” |
|
“US/Eastern” |
||
“Australia/Melbourne” |
||
default |
UTC |
|
|
Tz Aware |
|
If true, ensure that timestamp is tz-aware, adding the timezone (specified by tz_default) to timestamp, if necessary. |
||
type |
boolean |
|
examples |
false |
|
default |
True |