Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timestamp to correct format #248

Merged
merged 7 commits into from
Nov 27, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tube/etl/outputs/es/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ def check_to_run_etl(es, index_names):


def timestamp_from_transaction_time(dt):
return "time_{trans_time}".format(trans_time=dt.strftime("%Y-%m-%dT%H-%M-%S"))
return "time_{trans_time}".format(trans_time=dt.strftime("%Y%m%dT%H%M%SZ"))


def get_timestamp_from_index(es, versioned_index):
res = es.indices.get_alias(index=versioned_index, name="time_*")
iso_str = list(res[versioned_index]["aliases"].keys())[0].replace("plus", "+")[5:]
return datetime.strptime(iso_str, "%Y-%m-%dT%H:%M:%S")
return datetime.strptime(iso_str, "%Y%m%dT%H%M%SZ")


def putting_timestamp(es, index_to_write):
Expand Down
Loading