Skip to content

Commit

Permalink
Initialize datastore_root from cli args in cli.step(...) (#134)
Browse files Browse the repository at this point in the history
* Initialize datastore_root from cli args in cli.step(...)

Gitter thread - https://gitter.im/metaflow_org/community?at=5e4b8e24d56ddb68a4aff877

Metaflow initializes datastore_root to fetch user code in `step`
command. The behaviour defaults to relying on METAFLOW_DATASTORE_SYSROOT_S3
environment variable to initialize datastore_root. This patch checks if
--datastore_root cli arg can be used instead.

* remove cli.py:769-770
  • Loading branch information
savingoyal committed Feb 18, 2020
1 parent b9373e9 commit 84b3390
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions metaflow/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ def step(obj,
fg='magenta',
bold=False)

obj.datastore.datastore_root = obj.datastore_root
if obj.datastore.datastore_root is None:
obj.datastore.datastore_root = obj.datastore.get_datastore_root_from_config(obj.echo)

Expand Down
2 changes: 1 addition & 1 deletion metaflow/datastore/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def __init__(self,
"Try with a different --run-id.")
if self.datastore_root is None:
raise DataException("Datastore root not found. "
"Specify with DATASTORE_SYSROOT_%s "
"Specify with METAFLOW_DATASTORE_SYSROOT_%s "
"environment variable." % self.TYPE.upper())

self.event_logger = event_logger
Expand Down

0 comments on commit 84b3390

Please sign in to comment.