Skip to content

Commit 856b5f3

Browse files
authored
Feature store 1.0.3 (#284)
2 parents ba93f40 + 754e964 commit 856b5f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1840
-178
lines changed

THIRD_PARTY_LICENSES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ pandavro
229229
* Source code: https://github.com/ynqa/pandavro
230230
* Project home: https://github.com/ynqa/pandavro
231231

232+
plotly
233+
* Copyright (c) 2016-2018 Plotly, Inc
234+
* License: MIT License
235+
* Source code: https://github.com/plotly/plotly.py
236+
* Project home: https://plotly.com/
237+
232238
protobuf
233239
* Copyright 2008 Google Inc. All rights reserved.
234240
* License: Google Protobuf License

ads/common/decorator/runtime_dependency.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,9 @@ class OptionalDependency:
6464
OPTUNA = "oracle-ads[optuna]"
6565
SPARK = "oracle-ads[spark]"
6666
HUGGINGFACE = "oracle-ads[huggingface]"
67-
GREAT_EXPECTATIONS = "oracle-ads[great-expectations]"
67+
FEATURE_STORE = "oracle-ads[feature-store]"
6868
GRAPHVIZ = "oracle-ads[graphviz]"
6969
MLM_INSIGHTS = "oracle-ads[mlm_insights]"
70-
PYARROW = "oracle-ads[pyarrow]"
7170

7271

7372
def runtime_dependency(

ads/feature_store/.readthedocs.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Read the Docs configuration file
2+
3+
# Required
4+
version: 2
5+
6+
# Set the version of Python and other tools you might need
7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3.9"
11+
12+
# Build documentation in the docs/ directory with Sphinx
13+
sphinx:
14+
configuration: ads/feature_store/docs/source/conf.py
15+
16+
# Optionally declare the Python requirements required to build your docs
17+
python:
18+
install:
19+
- requirements: ads/feature_store/docs/requirements.txt

ads/feature_store/common/spark_session_singleton.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def __init__(self, metastore_id: str = None):
8484
)
8585
.enableHiveSupport()
8686
)
87+
_managed_table_location = None
8788

8889
if not developer_enabled() and metastore_id:
8990
# Get the authentication credentials for the OCI data catalog service
@@ -94,12 +95,11 @@ def __init__(self, metastore_id: str = None):
9495

9596
data_catalog_client = OCIClientFactory(**auth).data_catalog
9697
metastore = data_catalog_client.get_metastore(metastore_id).data
98+
_managed_table_location = metastore.default_managed_table_location
9799
# Configure the Spark session builder object to use the specified metastore
98100
spark_builder.config(
99101
"spark.hadoop.oracle.dcat.metastore.id", metastore_id
100-
).config(
101-
"spark.sql.warehouse.dir", metastore.default_managed_table_location
102-
).config(
102+
).config("spark.sql.warehouse.dir", _managed_table_location).config(
103103
"spark.driver.memory", "16G"
104104
)
105105

@@ -114,7 +114,12 @@ def __init__(self, metastore_id: str = None):
114114

115115
self.spark_session.conf.set("spark.sql.execution.arrow.pyspark.enabled", "true")
116116
self.spark_session.sparkContext.setLogLevel("OFF")
117+
self.managed_table_location = _managed_table_location
117118

118119
def get_spark_session(self):
119120
"""Access method to get the spark session."""
120121
return self.spark_session
122+
123+
def get_managed_table_location(self):
124+
"""Returns the managed table location for the spark"""
125+
return self.managed_table_location

ads/feature_store/common/utils/transformation_utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8; -*-
33
import json
4+
45
# Copyright (c) 2023 Oracle and/or its affiliates.
56
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
67

@@ -64,9 +65,13 @@ def apply_transformation(
6465
dataframe.createOrReplaceTempView(temporary_table_view)
6566

6667
transformed_data = spark.sql(
67-
transformation_function_caller(temporary_table_view, **transformation_kwargs_dict)
68+
transformation_function_caller(
69+
temporary_table_view, **transformation_kwargs_dict
70+
)
6871
)
6972
elif transformation.transformation_mode == TransformationMode.PANDAS.value:
70-
transformed_data = transformation_function_caller(dataframe, **transformation_kwargs_dict)
73+
transformed_data = transformation_function_caller(
74+
dataframe, **transformation_kwargs_dict
75+
)
7176

7277
return transformed_data

ads/feature_store/data_validation/great_expectation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
from great_expectations.validator.validator import Validator
2222
except ModuleNotFoundError:
2323
raise ModuleNotFoundError(
24-
f"The `great-expectations` module was not found. Please run `pip install "
25-
f"{OptionalDependency.GREAT_EXPECTATIONS}`."
24+
f"The `feature-store` module was not found. Please run `pip install "
25+
f"{OptionalDependency.FEATURE_STORE}`."
2626
)
2727
except Exception as e:
2828
raise

0 commit comments

Comments
 (0)