Skip to content

Commit e402aec

Browse files
committed
Place the api_key'd cwms init afer the get catalog. Catalog does not require a key.
1 parent d4e3391 commit e402aec

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

cwmscli/load/timeseries/timeseries_ids.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# cwmscli/load/timeseries_ids.py
2-
from turtle import pd
32
from typing import Optional
43

54
import click
@@ -27,8 +26,6 @@ def load_timeseries_ids(
2726
ts_ids = cwms.get_timeseries_identifiers(
2827
office_id=source_office, timeseries_id_regex=timeseries_id_regex
2928
).df
30-
31-
cwms.init_session(api_root=target_cda, api_key=target_api_key)
3229
# only grab time_ids for locations that are in the target database
3330
locations = cwms.get_locations_catalog(office_id=source_office)
3431
ts_ids[["location-id", "param", "type", "int", "dur", "ver"]] = ts_ids[
@@ -40,6 +37,7 @@ def load_timeseries_ids(
4037
if verbose:
4138
click.echo(f"Found {len(ts_lo_ids)} timeseries IDs to copy.")
4239

40+
cwms.init_session(api_root=target_cda, api_key=target_api_key)
4341
errors = 0
4442
for i, row in ts_lo_ids.iterrows():
4543
ts_id = row["time-series-id"]

0 commit comments

Comments
 (0)