Skip to content

Commit 2f9be39

Browse files
authored
Feature store preview (#226)
2 parents 34105b5 + 24aed7f commit 2f9be39

File tree

187 files changed

+23795
-18
lines changed

Some content is hidden

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

187 files changed

+23795
-18
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ repos:
1010
- id: check-json
1111
- id: check-merge-conflict
1212
- id: check-yaml
13+
exclude: feature_store_*.yaml
1314
args: ['--allow-multiple-documents']
1415
- id: detect-private-key
1516
- id: end-of-file-fixer

THIRD_PARTY_LICENSES.txt

Lines changed: 24 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
@@ -253,6 +259,12 @@ pyspark
253259
* Source code: https://github.com/apache/spark/tree/master/python
254260
* Project home: https://spark.apache.org/
255261

262+
pyarrow
263+
* Copyright 2004 and onwards The Apache Software Foundation.
264+
* License: Apache-2.0 LICENSE
265+
* Source code: https://github.com/apache/arrow/tree/main/python
266+
* Project home: https://arrow.apache.org/
267+
256268
python_jsonschema_objects
257269
* Copyright (c) 2014 Chris Wacek
258270
* License: MIT License
@@ -369,6 +381,18 @@ xgboost
369381
* Source code: https://github.com/dmlc/xgboost
370382
* Project home: https://xgboost.ai/
371383

384+
great-expectations
385+
* No listed copyright holder
386+
* License: Apache License 2.0
387+
* Source code: https://github.com/great-expectations/great_expectations
388+
* Project home: https://greatexpectations.io/
389+
390+
delta
391+
* Copyright (2021) The Delta Lake Project Authors. All rights reserved.
392+
* License: Apache License 2.0
393+
* Source code: https://github.com/delta-io/delta/
394+
* Project home: https://delta.io/
395+
372396
=============================== Licenses ===============================
373397
------------------------------------------------------------------------
374398

ads/common/decorator/runtime_dependency.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ class OptionalDependency:
6464
OPTUNA = "oracle-ads[optuna]"
6565
SPARK = "oracle-ads[spark]"
6666
HUGGINGFACE = "oracle-ads[huggingface]"
67+
FEATURE_STORE = "oracle-ads[feature-store]"
68+
GRAPHVIZ = "oracle-ads[graphviz]"
69+
MLM_INSIGHTS = "oracle-ads[mlm_insights]"
6770

6871

6972
def runtime_dependency(

ads/common/oci_client.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8; -*-
33

4-
# Copyright (c) 2021, 2022 Oracle and/or its affiliates.
4+
# Copyright (c) 2021, 2023 Oracle and/or its affiliates.
55
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
66

77
import logging
88

99
from oci.ai_language import AIServiceLanguageClient
10+
from oci.data_catalog import DataCatalogClient
1011
from oci.data_flow import DataFlowClient
1112
from oci.data_labeling_service import DataLabelingManagementClient
1213
from oci.data_labeling_service_dataplane import DataLabelingClient
1314
from oci.data_science import DataScienceClient
1415
from oci.identity import IdentityClient
1516
from oci.object_storage import ObjectStorageClient
17+
from oci.resource_search import ResourceSearchClient
1618
from oci.secrets import SecretsClient
1719
from oci.vault import VaultsClient
18-
1920
logger = logging.getLogger(__name__)
2021

2122

@@ -62,7 +63,15 @@ def _client_impl(self, client):
6263
"ai_language": AIServiceLanguageClient,
6364
"data_labeling_dp": DataLabelingClient,
6465
"data_labeling_cp": DataLabelingManagementClient,
66+
"resource_search": ResourceSearchClient,
67+
"data_catalog": DataCatalogClient
6568
}
69+
try:
70+
from oci.feature_store import FeatureStoreClient
71+
client_map["feature_store"] = FeatureStoreClient
72+
except ImportError:
73+
logger.warning("OCI SDK with feature store support is not installed")
74+
pass
6675

6776
assert (
6877
client in client_map
@@ -124,6 +133,18 @@ def ai_language(self):
124133
def data_labeling_cp(self):
125134
return self.create_client("data_labeling_cp")
126135

136+
@property
137+
def feature_store(self):
138+
return self.create_client("feature_store")
139+
127140
@property
128141
def data_labeling_dp(self):
129142
return self.create_client("data_labeling_dp")
143+
144+
@property
145+
def resource_search(self):
146+
return self.create_client("resource_search")
147+
148+
@property
149+
def data_catalog(self):
150+
return self.create_client("data_catalog")

ads/common/oci_mixin.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class MergeStrategy(Enum):
4141
MERGE = "merge"
4242

4343

44-
class OCIModelNotExists(Exception): # pragma: no cover
44+
class OCIModelNotExists(Exception): # pragma: no cover
4545
pass
4646

4747

@@ -383,7 +383,7 @@ class OCIModelMixin(OCISerializableMixin):
383383
"""
384384

385385
# Regex pattern matching the module name of an OCI model.
386-
OCI_MODEL_PATTERN = r"oci.[^.]+\.models[\..*]?"
386+
OCI_MODEL_PATTERN = r"(oci|feature_store_client).[^.]+\.models[\..*]?"
387387
# Constants
388388
CONS_COMPARTMENT_ID = "compartment_id"
389389

@@ -937,11 +937,11 @@ def get_work_request_response(
937937
return work_request_response
938938

939939
def wait_for_progress(
940-
self,
941-
work_request_id: str,
942-
num_steps: int = DEFAULT_WORKFLOW_STEPS,
943-
max_wait_time: int = DEFAULT_WAIT_TIME,
944-
poll_interval: int = DEFAULT_POLL_INTERVAL
940+
self,
941+
work_request_id: str,
942+
num_steps: int = DEFAULT_WORKFLOW_STEPS,
943+
max_wait_time: int = DEFAULT_WAIT_TIME,
944+
poll_interval: int = DEFAULT_POLL_INTERVAL,
945945
):
946946
"""Waits for the work request progress bar to be completed.
947947
@@ -969,10 +969,10 @@ def wait_for_progress(
969969
seconds_since = time.time() - start_time
970970
exceed_max_time = max_wait_time > 0 and seconds_since >= max_wait_time
971971
if exceed_max_time:
972-
logger.error(
973-
f"Max wait time ({max_wait_time} seconds) exceeded."
974-
)
975-
while not exceed_max_time and (not work_request_logs or len(work_request_logs) < num_steps):
972+
logger.error(f"Max wait time ({max_wait_time} seconds) exceeded.")
973+
while not exceed_max_time and (
974+
not work_request_logs or len(work_request_logs) < num_steps
975+
):
976976
time.sleep(poll_interval)
977977
new_work_request_logs = []
978978

ads/dataset/progress.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, max_progress=100, description="Running", verbose=False):
4141
self.start_time = time.time()
4242
self.description = description
4343

44-
def update(self, description=None):
44+
def update(self, description=None, n=1):
4545
"""
4646
Updates the progress bar
4747
"""
@@ -57,7 +57,7 @@ def update(self, description=None):
5757
description if description is not None else self.description
5858
)
5959
self.start_time = time.time()
60-
self.progress_bar.update(1)
60+
self.progress_bar.update(n)
6161
if description is not None:
6262
self.progress_bar.set_description(description, refresh=True)
6363

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/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*--
3+
4+
# Copyright (c) 2023 Oracle and/or its affiliates.
5+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6+
7+
import logging
8+
9+
logger = logging.getLogger(__name__)

ads/feature_store/common/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)