Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Issue of DataSource subclasses using parent abstract class docstrings #4730

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sdk/python/feast/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ def get_table_query_string(self) -> str:

@typechecked
class KafkaSource(DataSource):
"""A KafkaSource allow users to register Kafka streams as data sources."""

def __init__(
self,
*,
Expand Down Expand Up @@ -616,6 +618,8 @@ def source_datatype_to_feast_value_type() -> Callable[[str], ValueType]:

@typechecked
class KinesisSource(DataSource):
"""A KinesisSource allows users to register Kinesis streams as data sources."""

def validate(self, config: RepoConfig):
raise NotImplementedError

Expand Down Expand Up @@ -666,6 +670,25 @@ def __init__(
owner: Optional[str] = "",
batch_source: Optional[DataSource] = None,
):
"""
Args:
name: The unique name of the Kinesis source.
record_format: The record format of the Kinesis stream.
region: The AWS region of the Kinesis stream.
stream_name: The name of the Kinesis stream.
timestamp_field: Event timestamp field used for point-in-time joins of
feature values.
created_timestamp_column: Timestamp column indicating when the row
was created, used for deduplicating rows.
field_mapping: A dictionary mapping of column names in this data
source to feature names in a feature table or view. Only used for feature
columns, not entity or timestamp columns.
description: A human-readable description.
tags: A dictionary of key-value pairs to store arbitrary metadata.
owner: The owner of the Kinesis source, typically the email of the primary
maintainer.
batch_source: A DataSource backing the Kinesis stream (used for retrieving historical features).
"""
if record_format is None:
raise ValueError("Record format must be specified for kinesis source")

Expand Down
2 changes: 2 additions & 0 deletions sdk/python/feast/infra/offline_stores/bigquery_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

@typechecked
class BigQuerySource(DataSource):
"""A BigQuerySource object defines a data source that a BigQueryOfflineStore class can use."""

def __init__(
self,
*,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def to_proto(self) -> DataSourceProto.CustomSourceOptions:


class MsSqlServerSource(DataSource):
"""A MsSqlServerSource object defines a data source that a MsSqlServerOfflineStore class can use."""

def __init__(
self,
name: str,
Expand All @@ -124,6 +126,23 @@ def __init__(
tags: Optional[Dict[str, str]] = None,
owner: Optional[str] = None,
):
"""Creates a MsSqlServerSource object.

Args:
name: Name of the source, which should be unique within a project.
table_ref: The table reference.
event_timestamp_column: The event timestamp column (used for point-in-time joins of feature values).
created_timestamp_column: Timestamp column indicating when the row was created
(used for deduplicating rows).
field_mapping: A dictionary mapping of column names in this data
source to feature names in a feature table or view.
Only used for feature columns, not entity or timestamp columns.
date_partition_column: The date partition column.
connection_str: The connection string.
description: A human-readable description.
tags: A dictionary of key-value pairs to store arbitrary metadata.
owner: The owner of the data source, typically the email of the primary maintainer.
"""
# warnings.warn(
# "The Azure Synapse + Azure SQL data source is an experimental feature in alpha development. "
# "Some functionality may still be unstable so functionality can change in the future.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

@typechecked
class PostgreSQLSource(DataSource):
"""A PostgreSQLSource object defines a data source that a PostgreSQLOfflineStore class can use."""

def __init__(
self,
name: Optional[str] = None,
Expand All @@ -30,6 +32,24 @@ def __init__(
tags: Optional[Dict[str, str]] = None,
owner: Optional[str] = "",
):
"""Creates a PostgreSQLSource object.

Args:
name: Name of PostgreSQLSource, which should be unique within a project.
query: SQL query that will be used to fetch the data.
table: Table name.
timestamp_field (optional): Event timestamp field used for point-in-time joins of
feature values.
created_timestamp_column (optional): Timestamp column indicating when the row
was created, used for deduplicating rows.
field_mapping (optional): A dictionary mapping of column names in this data
source to feature names in a feature table or view. Only used for feature
columns, not entity or timestamp columns.
description (optional): A human-readable description.
tags (optional): A dictionary of key-value pairs to store arbitrary metadata.
owner (optional): The owner of the data source, typically the email of the primary
maintainer.
"""
self._postgres_options = PostgreSQLOptions(name=name, query=query, table=table)

# If no name, use the table as the default name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def to_proto(self) -> DataSourceProto.TrinoOptions:


class TrinoSource(DataSource):
"""A TrinoSource object defines a data source that a TrinoOfflineStore class can use."""

def __init__(
self,
*,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/feast/infra/offline_stores/file_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

@typechecked
class FileSource(DataSource):
"""A FileSource object defines a data source that a DaskOfflineStore or DuckDBOfflineStore class can use."""

def __init__(
self,
*,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/feast/infra/offline_stores/redshift_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

@typechecked
class RedshiftSource(DataSource):
"""A RedshiftSource object defines a data source that a RedshiftOfflineStore class can use."""

def __init__(
self,
*,
Expand Down
2 changes: 2 additions & 0 deletions sdk/python/feast/infra/offline_stores/snowflake_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

@typechecked
class SnowflakeSource(DataSource):
"""A SnowflakeSource object defines a data source that a SnowflakeOfflineStore class can use."""

def __init__(
self,
*,
Expand Down
Loading