-
Notifications
You must be signed in to change notification settings - Fork 14k
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
chore(db_engine_specs): Refactor get_index #23656
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -561,10 +561,18 @@ def latest_partition( | |||||||||
) | ||||||||||
|
||||||||||
column_names = indexes[0]["column_names"] | ||||||||||
part_fields = [(column_name, True) for column_name in column_names] | ||||||||||
sql = cls._partition_query(table_name, database, 1, part_fields) | ||||||||||
df = database.get_df(sql, schema) | ||||||||||
return column_names, cls._latest_partition_from_df(df) | ||||||||||
|
||||||||||
return column_names, cls._latest_partition_from_df( | ||||||||||
df=database.get_df( | ||||||||||
sql=cls._partition_query( | ||||||||||
table_name, | ||||||||||
database, | ||||||||||
Comment on lines
+568
to
+569
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.
Suggested change
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. I tend to only provide keywords if the variable names differ. 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. No problem. I generally like to always provide the pair to remove any ordering requirements. By the way, keyword arguments is one of my favorite Python features. |
||||||||||
limit=1, | ||||||||||
order_by=[(column_name, True) for column_name in column_names], | ||||||||||
), | ||||||||||
schema=schema, | ||||||||||
) | ||||||||||
) | ||||||||||
|
||||||||||
@classmethod | ||||||||||
def latest_sub_partition( | ||||||||||
|
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.
Same logic as before just a cleaner presentation including adding keyword arguments, i.e., previously it wasn't apparent in
cls._partition_query(table_name, database, 1, part_fields)
what1
andpart_fields
meant.