Skip to content

Commit d42c19a

Browse files
authored
fix: lazy import integrations to avoid pyspark bundling error and add deep research (#1)
* fix: lazy import integrations to avoid pyspark bundling error The CLI binary was failing with "No such file or directory: error-conditions.json" because pyspark was being eagerly imported when any integration was accessed. Changes: - Make integrations/__init__.py use lazy imports via __getattr__ - Update PyInstaller spec to use correct integration paths - Remove library-only integrations (polars, duckdb, spark) from bundle - Only bundle integrations with deploy capability (bigquery, snowflake) * feat: add --output option to search and extract commands * feat: add deep research command to CLI Add `parallel-cli research` command group for running deep research tasks: - `research run` - Create and run research tasks with polling - `research status` - Check task status - `research poll` - Resume polling existing tasks - `research processors` - List available processor tiers Also includes: - New core/research.py module with research API functions - Comprehensive tests with mocking (36 tests) - Refactored shared polling logic to reduce duplication - Added write_json_output() helper for consistent output handling * fix: separate markdown content from JSON metadata in research output * fix: update processor latencies to match documentation * fix: use TextSchemaParam to get markdown output from deep research * bump version and research updates * json * fix: add type assertions for pyrefly type checker Add assertions after validation to narrow optional types to non-None, fixing 10 pyrefly bad-argument-type errors in enrich_run and enrich_plan. * fix: resolve pyrefly type checking errors - Add explicit urllib.error import in auth.py - Use SDK BetaRunInputParam type in batch.py and spark/streaming.py - Add explicit type annotations to fix type inference issues - Use row.asDict() for proper PySpark Row field access - Add type narrowing assertion in test_cli.py - Exclude non-core files from pyrefly (cloud_function, examples, notebooks, scripts) - Add pyrefly pre-commit hook (local, uses uv run)
1 parent 5e2e3cc commit d42c19a

16 files changed

Lines changed: 1192 additions & 81 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ repos:
1414
- id: ruff-check
1515
# Run the formatter.
1616
- id: ruff-format
17+
- repo: local
18+
hooks:
19+
- id: pyrefly-check
20+
name: pyrefly (type checking)
21+
entry: uv run pyrefly check
22+
language: system
23+
pass_filenames: false
24+
types: [python]

‎parallel-web-tools.spec‎

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,18 @@ a = Analysis(
3636
'parallel_web_tools.cli',
3737
'parallel_web_tools.cli.commands',
3838
'parallel_web_tools.cli.planner',
39-
# Processors
39+
# Processors (for local file/db enrichment)
4040
'parallel_web_tools.processors',
4141
'parallel_web_tools.processors.csv',
4242
'parallel_web_tools.processors.duckdb',
4343
'parallel_web_tools.processors.bigquery',
44-
# Integrations
45-
'parallel_web_tools.polars',
46-
'parallel_web_tools.polars.enrich',
47-
'parallel_web_tools.duckdb',
48-
'parallel_web_tools.duckdb.batch',
49-
'parallel_web_tools.duckdb.udf',
50-
'parallel_web_tools.bigquery',
51-
'parallel_web_tools.bigquery.deploy',
52-
'parallel_web_tools.snowflake',
53-
'parallel_web_tools.snowflake.deploy',
54-
'parallel_web_tools.spark',
55-
'parallel_web_tools.spark.udf',
56-
'parallel_web_tools.spark.streaming',
44+
# Integrations with deploy capability (bundled in CLI)
45+
'parallel_web_tools.integrations',
46+
'parallel_web_tools.integrations.bigquery',
47+
'parallel_web_tools.integrations.bigquery.deploy',
48+
'parallel_web_tools.integrations.snowflake',
49+
'parallel_web_tools.integrations.snowflake.deploy',
50+
# Note: polars, duckdb, spark integrations are library-only (no deploy step)
5751
# Dependencies that might not be auto-detected
5852
'click',
5953
'questionary',
@@ -65,7 +59,6 @@ a = Analysis(
6559
'parallel',
6660
'duckdb',
6761
'sqlalchemy',
68-
'polars',
6962
'pandas',
7063
'certifi',
7164
],

‎parallel_web_tools/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
run_tasks,
2828
)
2929

30-
__version__ = "0.0.2"
30+
__version__ = "0.0.3"
3131

3232
__all__ = [
3333
# Auth

0 commit comments

Comments
 (0)