-
Notifications
You must be signed in to change notification settings - Fork 564
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
[docs] [Query Performance] #5136
Conversation
WalkthroughThis pull request introduces enhancements to the FiftyOne Teams documentation by adding a new section on "Query Performance" and updating existing documentation to reflect these changes. A new entry is included in the table of contents, and detailed descriptions of the Query Performance feature, including its functionalities and user interactions, are provided. Additionally, the documentation for managing dataset indexes in the FiftyOne App is updated to guide Teams customers on utilizing the built-in Query Performance panel. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning Rate limit exceeded@minhtuev has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 23 minutes and 23 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 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
Documentation and Community
|
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.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (3)
docs/source/teams/query_performance.rst (3)
3-9
: Improve title and introduction clarityA few suggestions to enhance readability and maintain brand consistency:
- Remove "(NEW)" from the title as it's temporary and will become outdated
- Consider replacing "subsumed" with "replaced" for clarity
- Fix the product name: "Fiftyone's" should be "FiftyOne's"
-Query Performance (NEW) +Query Performance ======================= Query Performance is a feature built into the :ref:`FiftyOne Teams App <teams-app>` which allows users to use FiftyOne to improve the performance of sidebar and background -queries through the use of indexes and summary fields. Query Performance subsumed and -expanded the capabilities of the previous Fiftyone's Lightning Mode (LM). +queries through the use of indexes and summary fields. Query Performance replaced and +expanded the capabilities of the previous FiftyOne's Lightning Mode (LM).
42-44
: Improve environment variables documentationThe environment variables section needs consistent formatting:
- Use inline code formatting for environment variables
- Add missing punctuation
- Use consistent quotation marks
-Admins users can change the default setting for all users in the Teams App by setting -`FIFTYONE_APP_DEFAULT_QUERY_PERFORMANCE` to `false`. Admin users can also completely disable -query performance for all users by setting the `FIFTYONE_APP_ENABLE_QUERY_PERFORMANCE` to `false`. +Admin users can change the default setting for all users in the Teams App by setting +``FIFTYONE_APP_DEFAULT_QUERY_PERFORMANCE`` to ``false``. Admin users can also completely disable +query performance for all users by setting ``FIFTYONE_APP_ENABLE_QUERY_PERFORMANCE`` to ``false``.
53-54
: Fix grammatical errorThere's a grammatical error in the sentence.
-example you can click on a label filter on the sidebar, and if the filter takes too longer +example you can click on a label filter on the sidebar, and if the filter takes too long
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (8)
docs/source/images/teams/qp_config.png
is excluded by!**/*.png
,!**/*.png
docs/source/images/teams/qp_create_index.png
is excluded by!**/*.png
,!**/*.png
docs/source/images/teams/qp_create_summary_field.png
is excluded by!**/*.png
,!**/*.png
docs/source/images/teams/qp_home.png
is excluded by!**/*.png
,!**/*.png
docs/source/images/teams/qp_tableview.png
is excluded by!**/*.png
,!**/*.png
docs/source/images/teams/qp_toast.png
is excluded by!**/*.png
,!**/*.png
docs/source/images/teams/qp_toggle.png
is excluded by!**/*.png
,!**/*.png
docs/source/images/teams/qp_tooltip.png
is excluded by!**/*.png
,!**/*.png
📒 Files selected for processing (2)
docs/source/teams/index.rst
(1 hunks)docs/source/teams/query_performance.rst
(1 hunks)
🔇 Additional comments (3)
docs/source/teams/index.rst (1)
147-147
: LGTM! Let's verify the referenced file.
The new entry follows the documentation structure and integrates well with the existing toctree.
Let's verify that the referenced documentation file exists:
✅ Verification successful
The referenced documentation file exists at the expected location ✅
The query_performance.rst
file is present at docs/source/teams/query_performance.rst
, confirming that the toctree entry is correctly linked to an existing documentation file.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the query_performance.rst file exists in the correct location
# Expected: File should exist in the teams directory
fd -t f "query_performance.rst" docs/source/teams
Length of output: 89
docs/source/teams/query_performance.rst (2)
95-98
: Well-structured warning messages
The warning sections effectively communicate important operational considerations about index creation and summary field operations. They provide valuable guidance for users working with large datasets.
Also applies to: 118-121
71-73
: Clarify default indexes
The documentation mentions "default indexes" but doesn't specify what these are. Consider adding details about which indexes are created by default and their purpose.
For dataset with a large number of samples, creating, updating and deleting a summary field can take a long time to | ||
complete. | ||
|
||
For more information on summary fields, see :ref:`_summary-fields`. |
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.
Fix broken cross-reference syntax
The cross-reference syntax is incorrect. Remove the underscore prefix from the reference target.
-For more information on summary fields, see :ref:`_summary-fields`.
+For more information on summary fields, see :ref:`summary-fields`.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
For more information on summary fields, see :ref:`_summary-fields`. | |
For more information on summary fields, see :ref:`summary-fields`. |
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.
A few grammatical changes, and suggestions to remove certain paragraphs.
Query Performance Toast | ||
----------------------- | ||
|
||
When you open the FiftyOne Teams App with Query Performance enabled, you will see a toast | ||
notification whenever a query is run that could benefit from Query Performance. The query | ||
can be part of the background sampling process or a query that you run manually from the | ||
side bar. Sidebar queries are queries that you run by clicking on the sidebar filters; for | ||
example you can click on a label filter on the sidebar, and if the filter takes too longer | ||
the toast will be opened. |
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 don't think we need to document the toast.
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 we need to document the Dismiss behavior?
* Single child for tooltip --------- Co-authored-by: minhtuevo <[email protected]>
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
app/packages/core/src/plugins/SchemaIO/components/TableView.tsx (1)
Line range hint
282-290
: Consider improving type safety and performance of formatCellValue.
- The
value
parameter is typed as string but could receive any type fromitem[key]
. Consider using a more accurate type.- The function would benefit from memoization since it's called frequently during table renders.
Consider this improvement:
-function formatCellValue(value: string, props: ViewPropsType) { +function formatCellValue(value: string | number | null | undefined, props: ViewPropsType): string { const round = props?.schema?.view?.round; const valueAsFloat = parseFloat(String(value)); if (!Number.isNaN(valueAsFloat) && typeof round === "number") { return valueAsFloat.toFixed(round); } - return value; + return String(value ?? ''); }And wrap the function with React.useCallback when used in the component:
const memoizedFormatCellValue = useCallback( (value, props) => formatCellValue(value, props), [props?.schema?.view?.round] );
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
app/packages/core/src/plugins/SchemaIO/components/ActionsMenu.tsx
(1 hunks)app/packages/core/src/plugins/SchemaIO/components/TableView.tsx
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- app/packages/core/src/plugins/SchemaIO/components/ActionsMenu.tsx
🧰 Additional context used
📓 Path-based instructions (1)
app/packages/core/src/plugins/SchemaIO/components/TableView.tsx (1)
Pattern **/*.{ts,tsx}
: Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.
🔇 Additional comments (2)
app/packages/core/src/plugins/SchemaIO/components/TableView.tsx (2)
186-186
: LGTM! Performance optimization through memoization.
The introduction of the content
variable prevents redundant calls to formatCellValue
, as the value is now computed once per cell render.
200-202
: LGTM! Improved tooltip rendering logic.
The simplified conditional rendering with pre-computed content enhances code readability and maintains the same functionality.
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.
Actionable comments posted: 4
🧹 Outside diff range and nitpick comments (3)
docs/source/teams/query_performance.rst (3)
6-8
: Simplify the feature descriptionThe introduction can be more concise and direct.
-Query Performance is a feature built into the :ref:`FiftyOne Teams App <teams-app>` -which allows users to use FiftyOne to improve the performance of the sidebar and background -queries through the use of indexes and summary fields. +The :ref:`FiftyOne Teams App <teams-app>` includes Query Performance, a feature that +improves sidebar and background query performance through indexes and summary fields.
90-93
: Enhance performance impact warningThe warning about performance impact should be more specific.
-For large, complex datasets, index creation can have an impact on the performance of the database. -It is recommended to consult and communicate with your database administrator and teammates -before attempting such an operation. +.. warning:: + + Index creation on large datasets can: + + - Temporarily increase database load + - Impact query performance during creation + - Require additional storage space + + Consult your database administrator before creating indexes on: + + - Datasets larger than 100GB + - Collections with high write volumes + - Production databases
136-136
: Add troubleshooting sectionConsider adding a troubleshooting section to help users diagnose and resolve common issues.
Example addition:
Troubleshooting -------------- Common Issues ~~~~~~~~~~~~ 1. **Slow Index Creation** - Ensure adequate disk space - Check for concurrent operations - Monitor system resources 2. **Missing Performance Improvements** - Verify index creation completion - Check query patterns match indexes - Review MongoDB explain plans 3. **Summary Field Updates** - Confirm dataset modifications - Check for schema changes - Verify field dependencies
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
docs/source/teams/query_performance.rst
(1 hunks)docs/source/user_guide/app.rst
(1 hunks)
🔇 Additional comments (2)
docs/source/teams/query_performance.rst (2)
33-35
: Remove tooltip documentation
As per previous feedback, the tooltip documentation should be removed as it's not essential information.
45-63
: Remove toast notification section
As per previous feedback, the toast notification documentation should be removed as it's not necessary to document this UI element.
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.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
docs/source/user_guide/app.rst
(1 hunks)
🔇 Additional comments (1)
docs/source/user_guide/app.rst (1)
578-579
: Documentation addition looks good
The added note provides valuable information to Teams customers about the Query Performance panel functionality and includes a helpful reference link for more details.
fdc984c
to
b470049
Compare
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.
Addressed feedback
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
5387a43
to
11c78e7
Compare
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
docs/source/teams/query_performance.rst (3)
3-4
: Remove "(NEW)" from the titleThe "(NEW)" marker in the title is not standard RST practice and should be removed. The newness of the feature should be communicated through release notes or change logs instead.
-Query Performance (NEW) +Query Performance
99-102
: Enhance the warning message with specific impactsThe warning message could be more specific about the types of performance impacts users might experience.
.. warning:: -For large, complex datasets, index creation can have an impact on the performance of the database. -It is recommended to consult and communicate with your database administrator and teammates -before attempting such an operation. +For large, complex datasets, index creation can: + +- Temporarily increase CPU and memory usage +- Slow down write operations during index building +- Require additional storage space + +Consult your database administrator and teammates before creating indexes, and schedule index +creation during off-peak hours.
110-113
: Add more specific examples of summary fieldsConsider adding more concrete examples of summary fields to help users better understand their applications.
The Query Performance panel also allows users to create a summary field. Summary fields are sample-level fields that are computed and stored in the database. For example, users can create a summary field for objects detected in every -frame. This allows users to filter quickly across the dataset to find samples with the desired objects. +frame. This allows users to filter quickly across the dataset to find samples with the desired objects. Other examples include: + +- Count of detected objects per frame +- Presence of specific object classes +- Aggregated confidence scores +- Custom metadata computations
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
docs/source/teams/query_performance.rst
(1 hunks)
🔇 Additional comments (5)
docs/source/teams/query_performance.rst (5)
33-35
: Remove tooltip documentation
As suggested in previous reviews, this tooltip documentation is not necessary for the user guide.
46-64
: Remove toast notification section
As suggested in previous reviews, the toast notification documentation is not necessary for the user guide. This level of UI detail is better suited for internal documentation or user onboarding materials.
68-82
: LGTM! Well-structured content
The section is well-organized with clear bullet points and follows the suggested structure from previous reviews.
122-138
: LGTM! Well-organized performance considerations
The section effectively consolidates all performance-related warnings and provides clear guidance for users.
139-147
: LGTM! Concise operational instructions
The sections provide clear and concise instructions for updating and deleting operations.
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
docs/source/teams/query_performance.rst (3)
3-4
: Remove "(NEW)" from the titleThe "(NEW)" marker in the title should be removed as it's not a standard documentation practice. Version control already tracks new additions, and this marker would become outdated over time.
-Query Performance (NEW) +Query Performance
99-102
: Enhance the performance impact warningThe warning about performance impact should be more specific and actionable.
.. warning:: -For large, complex datasets, index creation can have an impact on the performance of the database. -It is recommended to consult and communicate with your database administrator and teammates -before attempting such an operation. +Index creation on large, complex datasets can significantly impact database performance: + +- Memory usage may increase during index creation +- Write operations may be slower until index creation completes +- Database storage requirements will increase + +Best practices: + +- Consult your database administrator before creating indexes +- Schedule index creation during off-peak hours +- Monitor system resources during the operation
110-113
: Add a concrete example of summary field usageThe explanation would benefit from a specific example showing the performance improvement.
The Query Performance panel also allows users to create a summary field. Summary fields are sample-level fields that are computed and stored in the database. For example, users can create a summary field for objects detected in every -frame. This allows users to filter quickly across the dataset to find samples with the desired objects. +frame. This allows users to filter quickly across the dataset to find samples with the desired objects. For instance: + +.. code-block:: python + + # Without summary field - slower + # Scans all frames in all videos + dataset.match("frames.detections.label == 'person'") + + # With summary field - faster + # Uses pre-computed summary and index + dataset.match("detected_objects_summary.labels == 'person'")
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
docs/source/teams/query_performance.rst
(1 hunks)
🔇 Additional comments (2)
docs/source/teams/query_performance.rst (2)
33-35
: Remove tooltip documentation
As previously suggested, we should remove the tooltip documentation as it's not necessary to document this level of UI detail.
46-64
: Remove toast notification section
As previously suggested, we should remove the toast notification documentation as it's too detailed for this level of documentation. Users will naturally discover these UI elements while using the application.
What changes are proposed in this pull request?
Added documentation for Query Performance panel
How is this patch tested? If it is not, please explain why.
Release Notes
Is this a user-facing change that should be mentioned in the release notes?
notes for FiftyOne users.
(Details in 1-2 sentences. You can just refer to another PR with a description
if this PR is part of a larger change.)
What areas of FiftyOne does this PR affect?
fiftyone
Python library changesSummary by CodeRabbit
New Features
Documentation