|
1 |
| -import warnings |
2 | 1 | from typing import Callable, Dict, Iterable, Optional, Tuple
|
3 | 2 |
|
4 | 3 | from feast import type_map
|
5 | 4 | from feast.data_source import DataSource
|
6 |
| -from feast.errors import DataSourceNotFoundException |
| 5 | +from feast.errors import DataSourceNoNameException, DataSourceNotFoundException |
7 | 6 | from feast.feature_logging import LoggingDestination
|
8 | 7 | from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto
|
9 | 8 | from feast.protos.feast.core.FeatureService_pb2 import (
|
@@ -56,26 +55,20 @@ def __init__(
|
56 | 55 |
|
57 | 56 |
|
58 | 57 | """
|
59 |
| - # The default Athena schema is named "public". |
| 58 | + |
60 | 59 | _database = "default" if table and not database else database
|
61 | 60 | self.athena_options = AthenaOptions(
|
62 | 61 | table=table, query=query, database=_database, data_source=data_source
|
63 | 62 | )
|
64 | 63 |
|
65 | 64 | if table is None and query is None:
|
66 | 65 | 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 |
79 | 72 |
|
80 | 73 | super().__init__(
|
81 | 74 | name=_name if _name else "",
|
|
0 commit comments