Skip to content

Commit b813541

Browse files
thodson-usgsclaude
andcommitted
Tighten _arrange_cols comments
Drop the regression-narrative phrasing for the local-copy comment and trim the multi-line "id is technically a valid column..." block to a two-line WHY explaining the rename intent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 38c1fed commit b813541

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

dataretrieval/waterdata/utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,14 +687,12 @@ def _arrange_cols(
687687
# If properties are provided, filter to only those columns
688688
# plus geometry if skip_geometry is False
689689
if properties and not all(pd.isna(properties)):
690-
# Work on a local copy so we don't mutate the caller's list across calls.
690+
# Don't alias the caller's list — we mutate below.
691691
local_properties = list(properties)
692-
# Make sure geometry stays in the dataframe if skip_geometry is False
693692
if "geometry" in df.columns and "geometry" not in local_properties:
694693
local_properties.append("geometry")
695-
# id is technically a valid column from the service, but these
696-
# functions make the name more specific. So, if someone requests
697-
# 'id', give them the output_id column
694+
# 'id' is a valid service column, but expose it under the
695+
# service-specific output_id name instead.
698696
if "id" in local_properties:
699697
local_properties[local_properties.index("id")] = output_id
700698
df = df.loc[:, [col for col in local_properties if col in df.columns]]

0 commit comments

Comments
 (0)