Skip to content
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

feat(ingest): add ingest --no-progress option #9300

Merged
merged 9 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Usage: datahub [datahub-options] ingest [command-options]

Command Options:
-c / --config Config file in .toml or .yaml format
-q / --quiet Mute intermediate ingestion reports
-n / --dry-run Perform a dry run of the ingestion, essentially skipping writing to sink
--preview Perform limited ingestion from the source to the sink to get a quick preview
--preview-workunits The number of workunits to produce for preview
Expand Down
11 changes: 11 additions & 0 deletions metadata-ingestion/src/datahub/cli/ingest_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ def ingest() -> None:
help="Config file in .toml or .yaml format.",
required=True,
)
@click.option(
"-q",
"--quiet",
type=bool,
is_flag=True,
default=False,
help="Mute intermediate ingestion reports.",
)
@click.option(
"-n",
"--dry-run",
Expand Down Expand Up @@ -99,6 +107,7 @@ def ingest() -> None:
)
@telemetry.with_telemetry(
capture_kwargs=[
"quiet",
"dry_run",
"preview",
"strict_warnings",
Expand All @@ -109,6 +118,7 @@ def ingest() -> None:
)
def run(
config: str,
quiet: bool,
dry_run: bool,
preview: bool,
strict_warnings: bool,
Expand Down Expand Up @@ -162,6 +172,7 @@ async def run_ingestion_and_check_upgrade() -> int:
# logger.debug(f"Using config: {pipeline_config}")
pipeline = Pipeline.create(
pipeline_config,
quiet,
dry_run,
preview,
preview_workunits,
Expand Down
4 changes: 3 additions & 1 deletion metadata-ingestion/src/datahub/ingestion/run/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@ class Pipeline:
def __init__(
self,
config: PipelineConfig,
quiet: bool = False,
dry_run: bool = False,
preview_mode: bool = False,
preview_workunits: int = 10,
report_to: Optional[str] = None,
no_default_report: bool = False,
):
self.config = config
self.quiet = quiet
self.dry_run = dry_run
self.preview_mode = preview_mode
self.preview_workunits = preview_workunits
Expand Down Expand Up @@ -379,7 +381,7 @@ def run(self) -> None:
self.preview_workunits if self.preview_mode else None,
):
try:
if self._time_to_print():
if self._time_to_print() and not self.quiet:
self.pretty_print_summary(currently_running=True)
except Exception as e:
logger.warning(f"Failed to print summary {e}")
Expand Down
Loading