Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Revert "revert docstring"
Browse files Browse the repository at this point in the history
This reverts commit 81639be.
  • Loading branch information
Aaron Kanzer authored and Aaron Kanzer committed Jul 18, 2024
1 parent 81639be commit 06492d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lincbrain/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def check_schema_version(self, schema_version: str | None = None) -> None:
"""
if schema_version is None:
schema_version = models.get_schema_version()
server_info = self.get("/info/")
server_info = self.get("/info/") # 0.6.7
server_schema_version = server_info.get("schema_version")
if not server_schema_version:
raise RuntimeError(
Expand Down
9 changes: 5 additions & 4 deletions lincbrain/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,10 @@ def move(
if dandiset is None:
dandiset = Path()
with ExitStack() as stack:
client = DandiAPIClient.for_dandi_instance(dandi_instance)
client.dandi_authenticate()
stack.enter_context(client)

mover: Mover
client: DandiAPIClient | None = None
if work_on is MoveWorkOn.AUTO:
Expand All @@ -811,8 +815,6 @@ def move(
if isinstance(dandiset, str):
raise TypeError("`dandiset` must be a Path when work_on='both'")
local_ds, subpath = find_dandiset_and_subpath(dandiset)
client = DandiAPIClient.for_dandi_instance(dandi_instance)
stack.enter_context(client)
remote_ds = client.get_dandiset(
local_ds.identifier, version_id="draft", lazy=False
)
Expand All @@ -833,15 +835,14 @@ def move(
if not isinstance(url, DandisetURL):
raise ValueError("URL does not point to a Dandiset")
client = url.get_client()
client.dandi_authenticate()
stack.enter_context(client)
rds = url.get_dandiset(client, lazy=False)
assert rds is not None
remote_ds = rds
subpath = Path()
else:
local_ds, subpath = find_dandiset_and_subpath(dandiset)
client = DandiAPIClient.for_dandi_instance(dandi_instance)
stack.enter_context(client)
remote_ds = client.get_dandiset(
local_ds.identifier, version_id="draft", lazy=False
)
Expand Down
2 changes: 1 addition & 1 deletion lincbrain/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def upload(
# session gets properly closed. Otherwise, pytest sometimes complains
# under obscure conditions.
client = stack.enter_context(DandiAPIClient.for_dandi_instance(dandi_instance))
client.check_schema_version()
client.check_schema_version() # Aaron
client.dandi_authenticate()

if os.environ.get("DANDI_DEVEL_INSTRUMENT_REQUESTS_SUPERLEN"):
Expand Down

0 comments on commit 06492d3

Please sign in to comment.