Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: plotly/plotly.py
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.5.0
Choose a base ref
...
head repository: plotly/plotly.py
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 18 commits
  • 8 files changed
  • 9 contributors

Commits on Oct 30, 2025

  1. Optimize validate_gantt

    The optimization achieves a **58x speedup** by eliminating the major performance bottleneck in pandas DataFrame processing. 
    
    **Key optimizations:**
    
    1. **Pre-fetch column data as numpy arrays**: The original code used `df.iloc[index][key]` for each cell access, which triggers pandas' slow row-based indexing mechanism. The optimized version extracts all column data upfront using `df[key].values` and stores it in a dictionary, then uses direct numpy array indexing `columns[key][index]` inside the loop.
    
    2. **More efficient key validation**: Replaced the nested loop checking for missing keys with a single list comprehension `missing_keys = [key for key in REQUIRED_GANTT_KEYS if key not in df]`.
    
    3. **Use actual DataFrame columns**: Instead of iterating over the DataFrame object itself (which includes metadata), the code now uses `list(df.columns)` to get only the actual column names.
    
    **Why this is dramatically faster:**
    - `df.iloc[index][key]` creates temporary pandas Series objects and involves complex indexing logic for each cell
    - Direct numpy array indexing `columns[key][index]` is orders of magnitude faster
    - The line profiler shows the original `df.iloc` line consumed 96.8% of execution time (523ms), while the optimized dictionary comprehension takes only 44.9% (4.2ms)
    
    **Performance characteristics:**
    - **Large DataFrames see massive gains**: 8000%+ speedup on 1000-row DataFrames
    - **Small DataFrames**: 40-50% faster 
    - **List inputs**: Slight slowdown (3-13%) due to additional validation overhead, but still microsecond-level performance
    - **Empty DataFrames**: Some slowdown due to upfront column extraction, but still fast overall
    
    This optimization is most beneficial for DataFrame inputs with many rows, where the repeated `iloc` calls created a severe performance bottleneck.
    codeflash-ai[bot] authored Oct 30, 2025
    Configuration menu
    Copy the full SHA
    688fe67 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6be6284 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9e2a2f0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7ddb02b View commit details
    Browse the repository at this point in the history
  5. fix formatting

    mashraf-222 committed Oct 30, 2025
    Configuration menu
    Copy the full SHA
    666dcc2 View commit details
    Browse the repository at this point in the history
  6. fixing formatting

    mashraf-222 committed Oct 30, 2025
    Configuration menu
    Copy the full SHA
    ef98a70 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2025

  1. Merge pull request #5422 from plotly/release-6.5.0

    Release v6.5.0
    emilykl authored Nov 17, 2025
    Configuration menu
    Copy the full SHA
    aa797c5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3458474 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2025

  1. Merge pull request #5423 from plotly/update-plotly-version

    Update plotly.py version for docs
    LiamConnors authored Nov 18, 2025
    Configuration menu
    Copy the full SHA
    043ff90 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0e84b4a View commit details
    Browse the repository at this point in the history
  3. remove conditional pandas

    KRRT7 committed Nov 18, 2025
    Configuration menu
    Copy the full SHA
    4c5dcd1 View commit details
    Browse the repository at this point in the history
  4. remove redundant tests

    KRRT7 committed Nov 18, 2025
    Configuration menu
    Copy the full SHA
    084595a View commit details
    Browse the repository at this point in the history
  5. apply ruff formatting

    KRRT7 committed Nov 18, 2025
    Configuration menu
    Copy the full SHA
    df67ffb View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2025

  1. add changelong entry

    KRRT7 committed Nov 19, 2025
    Configuration menu
    Copy the full SHA
    3dde3b6 View commit details
    Browse the repository at this point in the history
  2. apply suggestion

    Co-authored-by: Cameron DeCoster <cameron.decoster@gmail.com>
    KRRT7 and camdecoster authored Nov 19, 2025
    Configuration menu
    Copy the full SHA
    79fe9f4 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #5386 from codeflash-ai/codeflash/optimize-validat…

    …e_gantt-mhcxyu68
    
    ⚡️ Speed up function `validate_gantt` by 58x
    camdecoster authored Nov 19, 2025
    Configuration menu
    Copy the full SHA
    f083977 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2025

  1. Configuration menu
    Copy the full SHA
    2f1008f View commit details
    Browse the repository at this point in the history
  2. Merge pull request #5441 from plotly/cam/5440/update-github-issue-tem…

    …plates
    
    fix: Update GitHub issue templates
    camdecoster authored Dec 3, 2025
    Configuration menu
    Copy the full SHA
    509d1fc View commit details
    Browse the repository at this point in the history
Loading