-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add representative time mapping #19
base: main
Are you sure you want to change the base?
Conversation
initial commit
remove stale code
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #19 +/- ##
==========================================
+ Coverage 93.50% 93.81% +0.31%
==========================================
Files 18 30 +12
Lines 831 1374 +543
==========================================
+ Hits 777 1289 +512
- Misses 54 85 +31 ☔ View full report in Codecov by Sentry. |
* Refactor time range generation code * Support mapping time in the Store * Add missing type annotations * Remove duplication of representative time columns
|
||
res = df.groupby(["time_zone"])["timestamp"].count().unique().tolist() | ||
tru = [len(ts)] | ||
assert res == tru, "wrong number 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.
Do spot check.
Has `*** TypeError: must be real number, not str` on read_database(selectable, *args) when backend is sqlite3. read_database does not have this error if str sql is passed in instead.
on_stmt &= left_table.c[x] == right_table.c[x] | ||
query = select(*select_stmt).select_from(left_table).join(right_table, on_stmt) | ||
create_table(self._to_schema.name, query, self._engine, self._metadata) | ||
self._metadata.reflect(self._engine, views=True) |
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.
This is already happening in create_table, right? (and can be deleted)
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.
I think it's more complete for it to exists here. We should always update the metadata within the same function after creating something.
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.
It's not a cheap function, but it's time is nothing compared to the time to do this mapping. Still, though, I would prefer that we minimize the number of times it's called. If we end up calling create_table in 15 places, I really hope that every call site doesn't repeat this behavior. I think it would be fine to document in create_table that it takes care of the update. Also, I'm getting warning errors from duckdb_engine every time it's called.
Add support for representative time config and mapping from representative time to datetime