Skip to content

Commit

Permalink
fix: Fix DataSource constructor to unbreak custom data sources
Browse files Browse the repository at this point in the history
Signed-off-by: Achal Shah <[email protected]>
  • Loading branch information
achals committed Apr 5, 2022
1 parent ce35835 commit ea85086
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sdk/python/feast/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


import enum
import warnings
from abc import ABC, abstractmethod
from typing import Any, Callable, Dict, Iterable, Optional, Tuple

Expand Down Expand Up @@ -179,14 +180,15 @@ class DataSource(ABC):

def __init__(
self,
name: str,
*,
event_timestamp_column: Optional[str] = None,
created_timestamp_column: Optional[str] = None,
field_mapping: Optional[Dict[str, str]] = None,
date_partition_column: Optional[str] = None,
description: Optional[str] = "",
tags: Optional[Dict[str, str]] = None,
owner: Optional[str] = "",
name: Optional[str] = None,
):
"""
Creates a DataSource object.
Expand All @@ -205,7 +207,13 @@ def __init__(
owner (optional): The owner of the data source, typically the email of the primary
maintainer.
"""
self.name = name
if not name:
warnings.warn(
("Names for data sources need to be supplied. "
"Data sources without names will no tbe supported after Feast 0.23."),
UserWarning
)
self.name = name or ""
self.event_timestamp_column = (
event_timestamp_column if event_timestamp_column else ""
)
Expand Down

0 comments on commit ea85086

Please sign in to comment.