Skip to content

Commit

Permalink
Resolves #877.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Feb 14, 2025
1 parent 8de8951 commit 9da97fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion workbench
Original file line number Diff line number Diff line change
Expand Up @@ -3839,7 +3839,8 @@ logging.info(message)

check_drupal_core_version(config)

csv_subset_warning(config)
if config["task"] != "create_from_files":
csv_subset_warning(config)

if config["task"] in ["create", "create_from_files"]:
logging.info(
Expand Down
10 changes: 7 additions & 3 deletions workbench_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10714,12 +10714,16 @@ def csv_subset_warning(config):
"""Create a message indicating that the csv_start_row and csv_stop_row config
options are present and that a subset of the input CSV will be used.
"""
csv_data = list(get_csv_data(config))
start_row_id = csv_data[0][config["id_field"]]
stop_row_id = csv_data[-1][config["id_field"]]

if config["csv_start_row"] != 0 or config["csv_stop_row"] is not None:
message = f"Using a subset of the input CSV (will start at row {config['csv_start_row']}, stop at row {config['csv_stop_row']})."
message = f"Using a subset of the input CSV (will start at row {config['csv_start_row']} / row ID \"{start_row_id}\", stop at row {config['csv_stop_row']} / row ID \"{stop_row_id}\")."
if config["csv_start_row"] != 0 and config["csv_stop_row"] is None:
message = f"Using a subset of the input CSV (will start at row {config['csv_start_row']})."
message = f"Using a subset of the input CSV (will start at row {config['csv_start_row']} / row ID {start_row_id})."
if config["csv_start_row"] == 0 and config["csv_stop_row"] is not None:
message = f"Using a subset of the input CSV (will stop at row {config['csv_stop_row']})."
message = f"Using a subset of the input CSV (will stop at row {config['csv_stop_row']} / row ID {stop_row_id})."
print(message)
logging.info(message)

Expand Down

0 comments on commit 9da97fb

Please sign in to comment.