Skip to content

Conversation

devxpy
Copy link
Member

@devxpy devxpy commented Aug 25, 2025

Q/A checklist

  • I have tested my UI changes on mobile and they look acceptable
  • I have tested changes to the workflows in both the API and the UI
  • I have done a code review of my changes and looked at each line of the diff + the references of each function I have changed
  • My changes have not increased the import time of the server
How to check import time?

time python -c 'import server'

You can visualize this using tuna:

python3 -X importtime -c 'import server' 2> out.log && tuna out.log

To measure import time for a specific library:

$ time python -c 'import pandas'

________________________________________________________
Executed in    1.15 secs    fish           external
   usr time    2.22 secs   86.00 micros    2.22 secs
   sys time    0.72 secs  613.00 micros    0.72 secs

To reduce import times, import libraries that take a long time inside the functions that use them instead of at the top of the file:

def my_function():
    import pandas as pd
    ...

Legal Boilerplate

Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.

Copy link

coderabbitai bot commented Aug 25, 2025

Warning

Rate limit exceeded

@devxpy has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 7a4afb1 and 7b35acc.

📒 Files selected for processing (3)
  • routers/root.py (1 hunks)
  • widgets/copilot_stats_plots.py (2 hunks)
  • widgets/plotly_theme.py (1 hunks)
📝 Walkthrough

Walkthrough

  • routers/root.py: Logout now clears the entire session via request.session.clear() instead of popping a single FIREBASE_SESSION_COOKIE key. Redirect behavior unchanged.
  • widgets/copilot_stats_plots.py: Adds annotate_bot_versions(fig, bi, trunc_fn, pd_freq, dt_index, tz, color) to overlay vertical dashed lines for bot version dates across subplots, and a hidden Scatter trace to provide per-date hover labels. Integrated into existing plotting flow after retention.
  • widgets/plotly_theme.py: apply_consistent_styling now sets hoversubplots="axis" in layout. No signature changes elsewhere.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch analytics-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Nitpick comments (3)
widgets/copilot_stats_plots.py (3)

23-24: Remove unused import regex.D

This is flagged by Ruff (F401) and adds unnecessary import-time overhead. Safe to remove.

-from regex import D

96-97: Good call to annotate version changes—ensure resilience when no published run exists

If bi.published_run is None, annotate_bot_versions will raise. The function itself should guard, but if you prefer to avoid calling it in that case, wrap the call:

-    annotate_bot_versions(fig, bi, trunc_fn, pd_freq, dt_index, tz)
+    if getattr(bi, "published_run", None):
+        annotate_bot_versions(fig, bi, trunc_fn, pd_freq, dt_index, tz)

Note: If you adopt the internal guard suggested below, this outer check becomes optional.


438-446: Signature contains unused params (pd_freq, tz)

They’re not used in the function body. Either use them (e.g., format dates using tz) or drop them to keep the API tight. If you decide to remove them, update the callsite at Lines 96-97 accordingly.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7f95f9e and 7a4afb1.

📒 Files selected for processing (3)
  • routers/root.py (1 hunks)
  • widgets/copilot_stats_plots.py (3 hunks)
  • widgets/plotly_theme.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
widgets/copilot_stats_plots.py (2)
bots/models/bot_integration.py (1)
  • BotIntegration (163-585)
app_users/models.py (1)
  • full_name (161-177)
🪛 Ruff (0.12.2)
widgets/copilot_stats_plots.py

23-23: regex.D imported but unused

Remove unused import: regex.D

(F401)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (3.10.12, 1.8.3)
🔇 Additional comments (2)
routers/root.py (1)

174-177: Clearing full session on logout looks good—verify no needed state is lost

Full clear is typically the right move for auth sign-out. Just confirm there’s no required post-logout UX state (e.g., banner dismissals, AB-test buckets) stored in session that you intend to keep.

widgets/plotly_theme.py (1)

29-30: No action needed: current Plotly dependency supports hoversubplots="axis"

The project’s pyproject.toml pins Plotly at ^6.3.0 (>=6.3.0, <7.0.0), which is well above the version that introduced hoversubplots in 5.21 – so hoversubplots="axis" is fully supported out of the box. (github.com)

@devxpy devxpy force-pushed the analytics-v2 branch 2 times, most recently from 34311f0 to 8e72748 Compare August 25, 2025 13:04
refactor: clear entire session on logout
@devxpy devxpy merged commit ae6ad71 into master Aug 25, 2025
6 checks passed
@devxpy devxpy deleted the analytics-v2 branch August 25, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant