Skip to content

Commit ce1710c

Browse files
committed
enforce AthenaSource to have a name
Signed-off-by: Youngkyu OH <toping4445@gmail.com>
1 parent 327289e commit ce1710c

File tree

1 file changed

+8
-15
lines changed
  • sdk/python/feast/infra/offline_stores/contrib/athena_offline_store

1 file changed

+8
-15
lines changed

sdk/python/feast/infra/offline_stores/contrib/athena_offline_store/athena_source.py

+8-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import warnings
21
from typing import Callable, Dict, Iterable, Optional, Tuple
32

43
from feast import type_map
54
from feast.data_source import DataSource
6-
from feast.errors import DataSourceNotFoundException
5+
from feast.errors import DataSourceNoNameException, DataSourceNotFoundException
76
from feast.feature_logging import LoggingDestination
87
from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto
98
from feast.protos.feast.core.FeatureService_pb2 import (
@@ -56,26 +55,20 @@ def __init__(
5655
5756
5857
"""
59-
# The default Athena schema is named "public".
58+
6059
_database = "default" if table and not database else database
6160
self.athena_options = AthenaOptions(
6261
table=table, query=query, database=_database, data_source=data_source
6362
)
6463

6564
if table is None and query is None:
6665
raise ValueError('No "table" argument provided.')
67-
_name = name
68-
if not _name:
69-
if table:
70-
_name = table
71-
else:
72-
warnings.warn(
73-
(
74-
f"Starting in Feast 0.21, Feast will require either a name for a data source (if using query) "
75-
f"or `table`: {self.query}"
76-
),
77-
DeprecationWarning,
78-
)
66+
67+
# If no name, use the table as the default name.
68+
if name is None and table is None:
69+
raise DataSourceNoNameException()
70+
_name = name or table
71+
assert _name
7972

8073
super().__init__(
8174
name=_name if _name else "",

0 commit comments

Comments
 (0)