Skip to content

Commit

Permalink
✨ shorter version for path-to-file in snapshot (#3620)
Browse files Browse the repository at this point in the history
* ✨ shorter version for path-to-file in snapshot

* shorter argument name for manual inputs
  • Loading branch information
lucasrodes authored Nov 26, 2024
1 parent c5adbd0 commit b161353
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@click.command()
@click.option("--upload/--skip-upload", default=True, type=bool, help="Upload dataset to Snapshot")
{% if cookiecutter.dataset_manual_import == True %}
@click.option("--path-to-file", prompt=True, type=str, help="Path to local data file.")
@click.option("--path-to-file", "-f", prompt=True, type=str, help="Path to local data file.")
def main(path_to_file: str, upload: bool) -> None:
# Create a new snapshot.
snap = Snapshot(f"{{cookiecutter.namespace}}/{SNAPSHOT_VERSION}/{{cookiecutter.short_name}}.{{cookiecutter.file_extension}}")
Expand Down
4 changes: 2 additions & 2 deletions apps/wizard/etl_steps/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ def run_snap_step() -> None:

# Display next steps
if form.dataset_manual_import:
manual_import_instructions = "--path-to-file **relative path of file**"
manual_import_instructions = "-f **relative path of file**"
else:
manual_import_instructions = ""
st.subheader("Next steps")
Expand Down Expand Up @@ -845,7 +845,7 @@ def run_snap_step() -> None:
commands = ["uv", "run", "python", script_path]
if form.dataset_manual_import:
# Get snapshot local file
commands.extend(["--path-to-file", st.session_state["snapshot_file"]])
commands.extend(["-f", st.session_state["snapshot_file"]])
command_str = f"`{' '.join(commands)}`"

# Run step
Expand Down
2 changes: 1 addition & 1 deletion etl/scripts/archive/run_all_snapshots/run_all_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def main():
log.info(f"Skipping {snapshot_script} because it does not have --upload flag.")
continue
# Skip scripts that require the use of a local file.
if "--path-to-file" in snapshot_text:
if ("--path-to-file" in snapshot_text) or ("-f " in snapshot_text):
log.info(f"Skipping {snapshot_script} because it requires a local file.")
continue

Expand Down

0 comments on commit b161353

Please sign in to comment.