Skip to content

Commit

Permalink
Remove default value
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Dec 6, 2021
1 parent 972729f commit f7b9450
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
6 changes: 3 additions & 3 deletions flytekit/configuration/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

S3_SHARD_STRING_LENGTH = _config_common.FlyteIntegerConfigurationEntry("aws", "s3_shard_string_length", default=2)

S3_ENDPOINT = _config_common.FlyteStringConfigurationEntry("aws", "endpoint", default="http://localhost:30084")
S3_ENDPOINT = _config_common.FlyteStringConfigurationEntry("aws", "endpoint", default=None)

S3_ACCESS_KEY_ID = _config_common.FlyteStringConfigurationEntry("aws", "access_key_id", default="minio")
S3_ACCESS_KEY_ID = _config_common.FlyteStringConfigurationEntry("aws", "access_key_id", default=None)

S3_SECRET_ACCESS_KEY = _config_common.FlyteStringConfigurationEntry("aws", "secret_access_key", default="miniostorage")
S3_SECRET_ACCESS_KEY = _config_common.FlyteStringConfigurationEntry("aws", "secret_access_key", default=None)

S3_ACCESS_KEY_ID_ENV_NAME = "AWS_ACCESS_KEY_ID"

Expand Down
6 changes: 4 additions & 2 deletions flytekit/remote/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,17 @@ def __init__(
# Not exposing this as a property for now.
self._entrypoint_settings = entrypoint_settings

# Save the file access object locally, but also make it available for use from the context.
FlyteContextManager.with_context(FlyteContextManager.current_context().with_file_access(file_access).build())
raw_output_data_prefix = auth_config.RAW_OUTPUT_DATA_PREFIX.get() or os.path.join(
sdk_config.LOCAL_SANDBOX.get(), "control_plane_raw"
)
self._file_access = file_access or FileAccessProvider(
local_sandbox_dir=os.path.join(sdk_config.LOCAL_SANDBOX.get(), "control_plane_metadata"),
raw_output_prefix=raw_output_data_prefix,
)
# Save the file access object locally, but also make it available for use from the context.
FlyteContextManager.with_context(
FlyteContextManager.current_context().with_file_access(self._file_access).build()
)

# TODO: Reconsider whether we want this. Probably best to not cache.
self._serialized_entity_cache = OrderedDict()
Expand Down
6 changes: 5 additions & 1 deletion flytekit/types/pickle/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ def to_literal(self, ctx: FlyteContext, python_val: T, python_type: Type[T], exp
return Literal(scalar=Scalar(blob=Blob(metadata=meta, uri=remote_path)))

def guess_python_type(self, literal_type: LiteralType) -> typing.Type[FlytePickle[typing.Any]]:
if literal_type.blob is not None and literal_type.blob.format == FlytePickleTransformer.PYTHON_PICKLE_FORMAT:
if (
literal_type.blob is not None
and literal_type.blob.dimensionality == _core_types.BlobType.BlobDimensionality.SINGLE
and literal_type.blob.format == FlytePickleTransformer.PYTHON_PICKLE_FORMAT
):
return FlytePickle

raise ValueError(f"Transformer {self} cannot reverse {literal_type}")
Expand Down
8 changes: 4 additions & 4 deletions plugins/flytekit-data-fsspec/tests/test_persist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

def test_s3_setup_args():
kwargs = s3_setup_args()
assert kwargs == {"client_kwargs": {"endpoint_url": "http://localhost:30084"}}
assert kwargs == {}

with aws.S3_ENDPOINT.get_patcher("http://flyte:30084"):
with aws.S3_ENDPOINT.get_patcher("http://localhost:30084"):
kwargs = s3_setup_args()
assert kwargs == {"client_kwargs": {"endpoint_url": "http://flyte:30084"}}
assert kwargs == {"client_kwargs": {"endpoint_url": "http://localhost:30084"}}

with aws.S3_ACCESS_KEY_ID.get_patcher("access"):
kwargs = s3_setup_args()
assert kwargs == {"client_kwargs": {"endpoint_url": "http://localhost:30084"}}
assert kwargs == {}
assert os.environ[aws.S3_ACCESS_KEY_ID_ENV_NAME] == "access"


Expand Down

0 comments on commit f7b9450

Please sign in to comment.