-
Notifications
You must be signed in to change notification settings - Fork 31
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
Followup: Return TIMESTAMP columns as native Python datetime objects #437
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
312eb24
Changed the sql_path
Aymaru 41a881d
Transform dates from crate to python datetime
Aymaru 49076da
Datetime conversion implemented using map and generator
Aymaru c053da3
Updated tests
Aymaru feebd45
Using generators to work with large datasets
Aymaru 6566879
fix
Aymaru a38860b
test
Aymaru e4fa0fa
updated datetime transformation using generators and updated test cases
Aymaru 77b6550
cleaning debug prints
Aymaru ee77ec1
Passing a generator of the flags instead of passing the list of values
Aymaru 5b33589
Removed tests
Aymaru 7e39244
updated conversion of timestamps
Aymaru f750966
Added pandas dependency
Aymaru e6facf3
Changed pandas timestamp to python datetime && deleted pandas dependecy
Aymaru e6887f4
fixed - E226 missing whitespace around arithmetic operator
Aymaru a8ffdc3
Changed yield value
Aymaru 1c46079
Validate date type in processors
Aymaru 8ce9209
Fix tests: 979e82af6 adjusted the timestamps in the test fixture data
amotl ccc00a1
Fix tests: Use defined time zone when validating naive datetime objects
amotl a8532c5
Remove spurious `print` statement
amotl 2cc1b90
Fix error when using _both_ `types=true` and `error_trace=true` options
amotl f355164
Polish `datetime` conversion implementation
amotl 3154d32
Use `datetime.utcfromtimestamp`
amotl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,9 +80,6 @@ Date should have been set at the insert due to default value via python method:: | |
>>> dt.day == now.day | ||
True | ||
|
||
>>> (now - location.datetime_tz).seconds < 4 | ||
True | ||
|
||
Comment on lines
-83
to
-85
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this test case protect against anything significant? Currently, it croaks on my machine with a difference of |
||
Verify the return type of date and datetime:: | ||
|
||
>>> type(location.date) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does someone have a resource at hand where those column code types are enumerated? The table at 1 coincidentally lists
_timestamp without time zone
as1115
, but here the code is apparently expecting two-digit integer numbers.I will be happy to receive further pointers for better educating myself on this topic.
Footnotes
https://crate.io/docs/crate/reference/en/5.0/interfaces/postgres.html#pg-type ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://crate.io/docs/crate/reference/en/5.0/interfaces/http.html#column-types
The code here will probably also need to handle arrays of timestamps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will add the conversion for container types as well.
Reading up on your reference, I am asking myself whether it is appropriate that
type=15
(Unchecked object) is handled here as well?