Skip to content

Commit

Permalink
feature: Add Mariadb offline store
Browse files Browse the repository at this point in the history
Added MariaDB offline store
Added MariaDB template

Signed-off-by: Theodor Mihalache <[email protected]>
  • Loading branch information
tmihalac committed May 3, 2024
1 parent ee51fbf commit 82cb260
Show file tree
Hide file tree
Showing 22 changed files with 1,548 additions and 3 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ test-python-universal-mssql:
not test_snowflake" \
sdk/python/tests

test-python-universal-mariadb:
PYTHONPATH='.' \
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.offline_stores.contrib.mariadb_repo_configuration \
PYTEST_PLUGINS=feast.infra.offline_stores.contrib.mariadb_offline_store.tests \
FEAST_LOCAL_ONLINE_CONTAINER=True \
python -m pytest -n 8 --integration \
-k "not gcs_registry and \
not s3_registry and \
not test_lambda_materialization and \
not test_snowflake" \
sdk/python/tests

# To use Athena as an offline store, you need to create an Athena database and an S3 bucket on AWS.
# https://docs.aws.amazon.com/athena/latest/ug/getting-started.html
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
feast.infra.offline\_stores.contrib.mariadb\_offline\_store package
=================================================================

Subpackages
-----------

.. toctree::
:maxdepth: 4

feast.infra.offline_stores.contrib.mariadb_offline_store.tests

Submodules
----------

feast.infra.offline\_stores.contrib.mariadb\_offline\_store.mariadb module
----------------------------------------------------------------------

.. automodule:: feast.infra.offline_stores.contrib.mariadb_offline_store.mariadb
:members:
:undoc-members:
:show-inheritance:

feast.infra.offline\_stores.contrib.mariadb\_offline\_store.mariadb\_source module
------------------------------------------------------------------------------------

.. automodule:: feast.infra.offline_stores.contrib.mariadb_offline_store.mariadb_source
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: feast.infra.offline_stores.contrib.mariadb_offline_store
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
feast.infra.offline\_stores.contrib.mariadb\_offline\_store.tests package
=======================================================================

Submodules
----------

feast.infra.offline\_stores.contrib.mariadb\_offline\_store.tests.data\_source module
-----------------------------------------------------------------------------------

.. automodule:: feast.infra.offline_stores.contrib.mariadb_offline_store.tests.data_source
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: feast.infra.offline_stores.contrib.mariadb_offline_store.tests
:members:
:undoc-members:
:show-inheritance:
9 changes: 9 additions & 0 deletions sdk/python/docs/source/feast.infra.offline_stores.contrib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Subpackages

feast.infra.offline_stores.contrib.athena_offline_store
feast.infra.offline_stores.contrib.mssql_offline_store
feast.infra.offline_stores.contrib.mariadb_offline_store
feast.infra.offline_stores.contrib.postgres_offline_store
feast.infra.offline_stores.contrib.spark_offline_store
feast.infra.offline_stores.contrib.trino_offline_store
Expand Down Expand Up @@ -56,6 +57,14 @@ feast.infra.offline\_stores.contrib.trino\_repo\_configuration module
:undoc-members:
:show-inheritance:

feast.infra.offline\_stores.contrib.mariadb\_repo\_configuration module
---------------------------------------------------------------------

.. automodule:: feast.infra.offline_stores.contrib.mariadb_repo_configuration
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

Expand Down
1 change: 1 addition & 0 deletions sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ def materialize_incremental_command(ctx: click.Context, end_ts: str, views: List
"gcp",
"aws",
"snowflake",
"mariadb",
"spark",
"postgres",
"hbase",
Expand Down
10 changes: 8 additions & 2 deletions sdk/python/feast/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from feast.feature_view import DUMMY_ENTITY_ID, DUMMY_ENTITY_NAME, FeatureView
from feast.field import Field, from_value_type
from feast.infra.offline_stores.bigquery_source import BigQuerySource
from feast.infra.offline_stores.contrib.mariadb_offline_store.mariadb_source import (
MariaDBSource,
)
from feast.infra.offline_stores.contrib.mssql_offline_store.mssqlserver_source import (
MsSqlServerSource,
)
Expand Down Expand Up @@ -43,14 +46,16 @@ def update_data_sources_with_inferred_event_timestamp_col(
ts_column_type_regex_pattern = "TIMESTAMP[A-Z]*"
elif isinstance(data_source, SnowflakeSource):
ts_column_type_regex_pattern = "TIMESTAMP_[A-Z]*"
elif isinstance(data_source, MsSqlServerSource):
elif isinstance(data_source, MsSqlServerSource) or isinstance(
data_source, MariaDBSource
):
ts_column_type_regex_pattern = "TIMESTAMP|DATETIME"
else:
raise RegistryInferenceFailure(
"DataSource",
f"""
DataSource inferencing of timestamp_field is currently only supported
for FileSource, SparkSource, BigQuerySource, RedshiftSource, SnowflakeSource, MsSqlSource.
for FileSource, SparkSource, BigQuerySource, RedshiftSource, SnowflakeSource, MsSqlSource, MariaDB.
Attempting to infer from {data_source}.
""",
)
Expand All @@ -61,6 +66,7 @@ def update_data_sources_with_inferred_event_timestamp_col(
or isinstance(data_source, RedshiftSource)
or isinstance(data_source, SnowflakeSource)
or isinstance(data_source, MsSqlServerSource)
or isinstance(data_source, MariaDBSource)
or "SparkSource" == data_source.__class__.__name__
)

Expand Down
Empty file.
Loading

0 comments on commit 82cb260

Please sign in to comment.