Skip to content

Commit

Permalink
Set default as none
Browse files Browse the repository at this point in the history
Signed-off-by: Terence <terencelimxp@gmail.com>
  • Loading branch information
terryyylim committed Nov 18, 2020
1 parent 469f38c commit 36bc636
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
5 changes: 1 addition & 4 deletions sdk/python/feast/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,7 @@ def _serving_service(self):

@property
def _use_job_service(self) -> bool:
return (
self._config.exists(opt.JOB_SERVICE_URL)
and self._config.get(opt.JOB_SERVICE_URL) != ""
)
return self._config.exists(opt.JOB_SERVICE_URL)

@property
def _job_service(self):
Expand Down
28 changes: 14 additions & 14 deletions sdk/python/feast/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ConfigOptions(metaclass=ConfigMeta):
ENABLE_AUTH: str = "False"

#: Auth token for user authentication to Feast
AUTH_TOKEN: str = ""
AUTH_TOKEN: Optional[str] = None

#: Path to certificate(s) to secure connection to Feast Core
CORE_SERVER_SSL_CERT: str = ""
Expand All @@ -102,7 +102,7 @@ class ConfigOptions(metaclass=ConfigMeta):
SERVING_SERVER_SSL_CERT: str = ""

#: Default Feast Job Service URL
JOB_SERVICE_URL: str = ""
JOB_SERVICE_URL: Optional[str] = None

#: Enable or disable TLS/SSL to Feast Job Service
JOB_SERVICE_ENABLE_SSL: str = "False"
Expand Down Expand Up @@ -132,7 +132,7 @@ class ConfigOptions(metaclass=ConfigMeta):
SPARK_LAUNCHER: str = "dataproc" # standalone, dataproc, emr

#: Feast Spark Job ingestion jobs staging location
SPARK_STAGING_LOCATION: str = ""
SPARK_STAGING_LOCATION: Optional[str] = None

#: Feast Spark Job ingestion jar file
SPARK_INGESTION_JAR: str = "https://storage.googleapis.com/feast-jobs/spark/ingestion/feast-ingestion-spark-develop.jar"
Expand All @@ -141,22 +141,22 @@ class ConfigOptions(metaclass=ConfigMeta):
SPARK_STANDALONE_MASTER: str = "local[*]"

#: Directory where Spark is installed
SPARK_HOME: str = ""
SPARK_HOME: Optional[str] = None

#: Dataproc cluster to run Feast Spark Jobs in
DATAPROC_CLUSTER_NAME: str = ""
DATAPROC_CLUSTER_NAME: Optional[str] = None

#: Project of Dataproc cluster
DATAPROC_PROJECT: str = ""
DATAPROC_PROJECT: Optional[str] = None

#: Region of Dataproc cluster
DATAPROC_REGION: str = ""
DATAPROC_REGION: Optional[str] = None

#: File format of historical retrieval features
HISTORICAL_FEATURE_OUTPUT_FORMAT: str = "parquet"

#: File location of historical retrieval features
HISTORICAL_FEATURE_OUTPUT_LOCATION: str = ""
HISTORICAL_FEATURE_OUTPUT_LOCATION: Optional[str] = None

#: Default Redis host
REDIS_HOST: str = "localhost"
Expand All @@ -171,10 +171,10 @@ class ConfigOptions(metaclass=ConfigMeta):
STATSD_ENABLED: str = "False"

#: Default StatsD port
STATSD_HOST: str = ""
STATSD_HOST: Optional[str] = None

#: Default StatsD port
STATSD_PORT: str = ""
STATSD_PORT: Optional[str] = None

#: IngestionJob DeadLetter Destination
DEADLETTER_PATH: str = ""
Expand All @@ -184,16 +184,16 @@ class ConfigOptions(metaclass=ConfigMeta):
STENCIL_URL: str = ""

#: EMR cluster to run Feast Spark Jobs in
EMR_CLUSTER_ID: str = ""
EMR_CLUSTER_ID: Optional[str] = None

#: Region of EMR cluster
EMR_REGION: str = ""
EMR_REGION: Optional[str] = None

#: Template path of EMR cluster
EMR_CLUSTER_TEMPLATE_PATH: str = ""
EMR_CLUSTER_TEMPLATE_PATH: Optional[str] = None

#: Log path of EMR cluster
EMR_LOG_LOCATION: str = ""
EMR_LOG_LOCATION: Optional[str] = None

#: Oauth grant type
OAUTH_GRANT_TYPE: Optional[str] = None
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/tests/grpc/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_get_auth_metadata_plugin_oauth_should_raise_when_response_is_not_200(
def test_get_auth_metadata_plugin_oauth_should_raise_when_config_is_incorrect(
config_with_missing_variable,
):
with raises(NoOptionError):
with raises((RuntimeError, NoOptionError)):
get_auth_metadata_plugin(config_with_missing_variable)


Expand Down

0 comments on commit 36bc636

Please sign in to comment.