-
Notifications
You must be signed in to change notification settings - Fork 0
β‘ Bolt: [performance improvement] Optimize PyArrow .as_py() calls #2583
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
base: main
Are you sure you want to change the base?
Changes from all commits
efb93f0
3d98875
3f2634a
1e63e54
2c1b9f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -413,4 +413,6 @@ skips = ["*/domain/*"] | |
| [dependency-groups] | ||
| dev = [ | ||
| "bioetl[dev]", | ||
| "lxml>=6.0.2", | ||
| "pyyaml>=6.0.3", | ||
| ] | ||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,6 +42,11 @@ | |||||||
| from bioetl.infrastructure.config.contract_policy_loader import ( | ||||||||
| load_pipeline_contract_policy, | ||||||||
| ) | ||||||||
|
|
||||||||
| import sys | ||||||||
| from pathlib import Path | ||||||||
| sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent)) | ||||||||
|
Comment on lines
+46
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π§© Analysis chainπ Script executed: #!/bin/bash
# Verify whether path management is already centralized and how widespread per-file mutations are.
fd -i 'pyproject.toml' -i 'pytest.ini' -i 'tox.ini' -i 'conftest.py'
rg -n --type=py 'sys\.path\.insert\(' tests
rg -n 'pythonpath|pytest\.ini_options|tool\.pytest' pyproject.toml pytest.ini tox.ini 2>/dev/null || trueRepository: SatoryKono/BioactivityDataAcquisition Length of output: 1007 Remove module-level Line 48 mutates global import resolution at import time via This pattern appears across the test suite in multiple files:
Remove the import manipulation and rely on pytest's centralized path configuration. Cleanup-import sys
-from pathlib import Path
-sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent))π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||||
|
|
||||||||
| from scripts.schema import check_config_invariants as invariant_script | ||||||||
| from scripts.schema.validate_pipeline_configs import _canonical_script | ||||||||
|
|
||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,10 @@ | |
|
|
||
| from __future__ import annotations | ||
|
|
||
| import sys | ||
| from pathlib import Path | ||
| sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent.parent.parent)) | ||
|
|
||
|
Comment on lines
+5
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π§© Analysis chainπ Script executed: # First, explore the repository structure to understand the layout
find . -type f -name "conftest.py" | head -20Repository: SatoryKono/BioactivityDataAcquisition Length of output: 479 π Script executed: # Check if the target file exists and read its content
if [ -f "tests/unit/scripts/ci/test_quality_integral_gate.py" ]; then
head -20 "tests/unit/scripts/ci/test_quality_integral_gate.py"
else
echo "File not found at expected path"
# Try to find the file
find . -name "test_quality_integral_gate.py" -type f
fiRepository: SatoryKono/BioactivityDataAcquisition Length of output: 826 π Script executed: # Search for other sys.path.insert patterns in test files
rg "sys\.path\.insert\|sys\.path\.append" tests/ --type py -nRepository: SatoryKono/BioactivityDataAcquisition Length of output: 63 π Script executed: # Check the root conftest.py
cat tests/conftest.pyRepository: SatoryKono/BioactivityDataAcquisition Length of output: 12687 π Script executed: # Check for pytest configuration files
ls -la | grep -E "pytest\.ini|pyproject\.toml|setup\.cfg"Repository: SatoryKono/BioactivityDataAcquisition Length of output: 147 π Script executed: # Check the directory structure relative to the test file to understand the import path
ls -R tests/unit/scripts/ci/ | head -30Repository: SatoryKono/BioactivityDataAcquisition Length of output: 134 π Script executed: # Check where the scripts.ci module is located
find . -path "*scripts/ci*" -type f | grep -v __pycache__ | head -20Repository: SatoryKono/BioactivityDataAcquisition Length of output: 577 π Script executed: # Check pyproject.toml for pytest configuration
cat pyproject.toml | grep -A 20 "\[tool.pytest"Repository: SatoryKono/BioactivityDataAcquisition Length of output: 715 π Script executed: # Also check what the actual import structure looks like - where is scripts relative to src?
ls -la | head -20Repository: SatoryKono/BioactivityDataAcquisition Length of output: 1305 π Script executed: # Verify the exact import path the test needs
head -20 scripts/ci/quality_integral_gate.pyRepository: SatoryKono/BioactivityDataAcquisition Length of output: 587 Remove the per-module The pythonpath = ["src", "."]Alternatively, configure the path in the root π€ Prompt for AI Agents |
||
| from scripts.ci.quality_integral_gate import ArchitectureTestStats | ||
| from scripts.ci.quality_integral_gate import ( | ||
| TestHealthClassification as HealthClassification, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import re | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent.parent.parent)) | ||
|
Comment on lines
+4
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π§© Analysis chainπ Script executed: find . -name "test_report_duplication_baseline.py" -type fRepository: SatoryKono/BioactivityDataAcquisition Length of output: 140 π Script executed: fd -type f -name "conftest.py"Repository: SatoryKono/BioactivityDataAcquisition Length of output: 251 π Script executed: rg "sys\.path\.insert" tests/Repository: SatoryKono/BioactivityDataAcquisition Length of output: 682 π Script executed: git ls-files tests/ | head -20Repository: SatoryKono/BioactivityDataAcquisition Length of output: 1014 π Script executed: cat -n ./tests/unit/scripts/qa/test_report_duplication_baseline.py | head -20Repository: SatoryKono/BioactivityDataAcquisition Length of output: 1119 π Script executed: find tests/unit -name "conftest.py"Repository: SatoryKono/BioactivityDataAcquisition Length of output: 187 π Script executed: cat -n tests/conftest.py 2>/dev/null || cat -n tests/__init__.py 2>/dev/null || echo "No conftest or __init__ at tests/ level"Repository: SatoryKono/BioactivityDataAcquisition Length of output: 15949 π Script executed: ls -la | grep -E "pytest|pyproject|setup"Repository: SatoryKono/BioactivityDataAcquisition Length of output: 211 π Script executed: cat pyproject.toml 2>/dev/null | grep -A 10 "\[tool.pytest"Repository: SatoryKono/BioactivityDataAcquisition Length of output: 384 Remove the The π€ Prompt for AI Agents |
||
|
|
||
| from scripts.qa.report_duplication_baseline import _build_payload | ||
| from scripts.qa.report_duplication_baseline import _build_trend_summary | ||
|
|
||
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.
π§© Analysis chain
π Script executed:
Repository: SatoryKono/BioactivityDataAcquisition
Length of output: 264
π Script executed:
Repository: SatoryKono/BioactivityDataAcquisition
Length of output: 1181
pyyamlis already a runtime dependency; addition here is redundant.Line 23 declares
pyyaml>=6.0in the maindependenciessection. Sincebioetl[dev](line 415) includes all runtime dependencies, re-specifyingpyyaml>=6.0.3in[dependency-groups].devis unnecessary duplication.lxml>=6.0.2has no usage in the codebase. If it's required for type stubs or a specific dev tool, add a comment explaining its purpose. Otherwise, remove it.Proposed fix
[dependency-groups] dev = [ "bioetl[dev]", - "lxml>=6.0.2", - "pyyaml>=6.0.3", ]π Committable suggestion
π€ Prompt for AI Agents