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

Epoch values should be considered valid timestamps #260

Closed
MeltyBot opened this issue Nov 2, 2021 · 4 comments
Closed

Epoch values should be considered valid timestamps #260

MeltyBot opened this issue Nov 2, 2021 · 4 comments

Comments

@MeltyBot
Copy link
Contributor

MeltyBot commented Nov 2, 2021

Migrated from GitLab: https://gitlab.com/meltano/sdk/-/issues/262

Originally created by @stkbailey on 2021-11-02 00:33:39


Summary

From what I can tell, the SDK cannot currently parse epoch-encoded timestamps and instead pushes them through the handle_invalid_timestamp logic. This is because the timestamp parsing is done using the dateutil.parser.parse functionality. Example below:

from dateutil import parser

ts = 1634606164.000200
parser.parse(ts)

>>> ERROR: dateutil.parser._parser.ParserError: year 1634606164 is out of range: 1634606164.000200

However, if we use datetime.datetime.fromtimestamp, the value is parsed successfully.

from datetime import datetime
datetime.fromtimestamp(ts)

>>> datetime.datetime(2021, 10, 18, 21, 16, 4, 200)

In this scenario, I would like to be able to use ts as a date-time formatted replication key column, but the strategy for doing so is not entirely clear to me.

Proposed benefits

Enabling epoch parsing would allow more timestamp data to be treated in a "standard" way.

Proposal details

I would like to see the SDK handle this case easily, to reduce friction when developing against this type of data.

Best reasons not to build

It is not entirely clear to me whether handling the data as a timestamp is the best way to approach this problem. Should we add a new "format" -- date_epoch? The major issue I could see is that, if an epoch timestamp is used as the replication key (e.g.), it would need to remain unconverted when being pushed to the external system. (The SDK shouldn't convert epoch -> date_iso8601, and then send that timestamp in the request.)

@MeltyBot
Copy link
Contributor Author

@labelsync-manager labelsync-manager bot added the kind/Feature New feature or request label Jun 23, 2022
@stale
Copy link

stale bot commented Jul 18, 2023

This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.

@edgarrmondragon
Copy link
Collaborator

@stale stale bot removed the stale label Jul 18, 2023
Copy link

stale bot commented Jul 17, 2024

This has been marked as stale because it is unassigned, and has not had recent activity. It will be closed after 21 days if no further activity occurs. If this should never go stale, please add the evergreen label, or request that it be added.

@stale stale bot added the stale label Jul 17, 2024
@stale stale bot closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants