-
Notifications
You must be signed in to change notification settings - Fork 58
chore: Improve CLI startup with lazy heavy import cleanup #330
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5f3a316
perf: defer heavy imports to improve CLI startup time
johnnygreco 1769842
perf: defer pandas/numpy in io_helpers and add config_list benchmark
johnnygreco 820815a
Refine lazy import usage and TYPE_CHECKING cleanup
johnnygreco 92c61ec
Run license header updater on PR-touched files
johnnygreco 1a95f75
fix: update sqlfluff mock target for lazy imports in test_sql
johnnygreco fb812c1
perf: cache globals() in lazy __getattr__ to avoid repeated lookups
johnnygreco 9acacdd
perf: lazy CLI command loading and deferred heavy import evaluations
johnnygreco 4f711f5
refactor: use direct pandas import in seed_source_dataframe
johnnygreco 4ed31a5
update lazy import pattern
johnnygreco 17fc695
update tests to use lazy import namespace
johnnygreco 5a8f3ca
Merge branch 'main' into johnny/chore/improve-cli-startup-time
johnnygreco ed89d14
tighten import perf test thresholds
johnnygreco 2b87adb
document pandas import requirement
johnnygreco da6350f
increase timeout time
johnnygreco 0294d3b
Merge branch 'main' into johnny/chore/improve-cli-startup-time
johnnygreco 3cb4957
use lazy pandas imports in visualization tests
johnnygreco aa79e67
fix lazy pandas runtime usage and preview mocks
johnnygreco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/data-designer-config/src/data_designer/config/seed_source_dataframe.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from typing import Literal | ||
|
|
||
| # Keep direct pandas import: Pydantic resolves DataFrame at module load, | ||
| # and this also preserves IDE typing/autocomplete. | ||
| import pandas as pd | ||
| from pydantic import ConfigDict, Field | ||
| from pydantic.json_schema import SkipJsonSchema | ||
|
|
||
| from data_designer.config.seed_source import SeedSource | ||
|
|
||
|
|
||
| class DataFrameSeedSource(SeedSource): | ||
| seed_type: Literal["df"] = "df" | ||
|
|
||
| model_config = ConfigDict(arbitrary_types_allowed=True) | ||
|
|
||
| df: SkipJsonSchema[pd.DataFrame] = Field( | ||
| ..., | ||
| exclude=True, | ||
| description=( | ||
| "DataFrame to use directly as the seed dataset. NOTE: if you need to write a Data Designer config, " | ||
| "you must use `LocalFileSeedSource` instead, since DataFrame objects are not serializable." | ||
| ), | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.