-
Notifications
You must be signed in to change notification settings - Fork 3k
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(ingest/bq): fix ordering of queries for use_queries_v2 #11333
fix(ingest/bq): fix ordering of queries for use_queries_v2 #11333
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
for queries_in_bucket in queries_deduped.values(): | ||
# Assuming that FileBackedDict is an OrderedDict. | ||
# If this is not the case, we would need to order it by "last_query_timestamp" | ||
# using queries_in_bucket.sql_query_iterator. |
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'm not sure this assumption is valid - might need to write some tests to valid this, but I think sqlite doesn't guarantee anything
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.
yeah we will need to tweak the code here
def __iter__(self) -> Iterator[str]: |
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'm not superfamilar with file_backed_collections code. I updated the queries_extractor to use order by sql query when reading the results.
for row in queries_in_bucket.sql_query_iterator( | ||
"select value from data order by last_query_timestamp asc", | ||
): | ||
query = queries_in_bucket.deserializer(row["value"]) |
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 fine, but it'd be even better if we just modified FileBackedDict
to handle this properly
@mayurinehate doing this improvement here #11346 |
@mayurinehate going to merge this for now, but please create a follow-up PR that takes advantage of #11333 |
Checklist