Conversation
There was a problem hiding this comment.
Pull Request Overview
Optimize the query function to construct DataFrames with an index in one step, introduce named indexes, and deprecate unused parameters.
- Directly pass the index to
pd.DataFramefor faster construction - Use a named index (
"$index"or the provided column name) - Add deprecation warnings for the now-ignored
blobsandnumpyarguments
Comments suppressed due to low confidence (5)
quasardb/pandas/init.py:187
- Docstring is missing a
Returnssection—please document that the function returns apandas.DataFrame.
Execute *query* and return the result as a pandas DataFrame.
quasardb/pandas/init.py:201
- Combine parameter names in the docstring is confusing; list
blobsandnumpyeach with their own description line.
blobs, numpy
quasardb/pandas/init.py:205
- Add unit tests to verify that passing non-default values for
blobsandnumpytriggers aDeprecationWarning.
# ------------------------------------------------------------------ deprecations
quasardb/pandas/init.py:206
- Inconsistent indentation: this
ifshould align with the function’s 4-space indent level (remove the extra space beforeif).
if blobs is not False:
quasardb/pandas/init.py:213
- Inconsistent indentation: this
ifshould align with the function’s 4-space indent level (remove the extra space beforeif).
if numpy is not True:
| df = pd.DataFrame(m) | ||
| index_vals, m = qdbnp.query(cluster, query, index=index, dict=True) | ||
|
|
||
| index_name = "$index" if index is None else index |
There was a problem hiding this comment.
[nitpick] Consider extracting the magic string "$index" into a module-level constant to improve clarity and avoid duplication.
Suggested change
| index_name = "$index" if index is None else index | |
| index_name = DEFAULT_INDEX_NAME if index is None else index |
vikonix
approved these changes
Jun 11, 2025
solatis
added a commit
that referenced
this pull request
Jun 11, 2025
* Constructing dataframe while providing index at the same time is much faster * We're now using named indexes, so users can refer to e.g. df['$timestamp'] and it will work * Added deprecation notices for unused parameters
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
df['$timestamp']and it will work