Skip to content

Commit 2d2380e

Browse files
dandawgshuchu
authored andcommitted
fix: Issue of DataSource subclasses using parent abstract class docstrings (feast-dev#4730)
1 parent 1490395 commit 2d2380e

8 files changed

Lines changed: 72 additions & 0 deletions

File tree

sdk/python/feast/data_source.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ def get_table_query_string(self) -> str:
343343

344344
@typechecked
345345
class KafkaSource(DataSource):
346+
"""A KafkaSource allow users to register Kafka streams as data sources."""
347+
346348
def __init__(
347349
self,
348350
*,
@@ -616,6 +618,8 @@ def source_datatype_to_feast_value_type() -> Callable[[str], ValueType]:
616618

617619
@typechecked
618620
class KinesisSource(DataSource):
621+
"""A KinesisSource allows users to register Kinesis streams as data sources."""
622+
619623
def validate(self, config: RepoConfig):
620624
raise NotImplementedError
621625

@@ -666,6 +670,25 @@ def __init__(
666670
owner: Optional[str] = "",
667671
batch_source: Optional[DataSource] = None,
668672
):
673+
"""
674+
Args:
675+
name: The unique name of the Kinesis source.
676+
record_format: The record format of the Kinesis stream.
677+
region: The AWS region of the Kinesis stream.
678+
stream_name: The name of the Kinesis stream.
679+
timestamp_field: Event timestamp field used for point-in-time joins of
680+
feature values.
681+
created_timestamp_column: Timestamp column indicating when the row
682+
was created, used for deduplicating rows.
683+
field_mapping: A dictionary mapping of column names in this data
684+
source to feature names in a feature table or view. Only used for feature
685+
columns, not entity or timestamp columns.
686+
description: A human-readable description.
687+
tags: A dictionary of key-value pairs to store arbitrary metadata.
688+
owner: The owner of the Kinesis source, typically the email of the primary
689+
maintainer.
690+
batch_source: A DataSource backing the Kinesis stream (used for retrieving historical features).
691+
"""
669692
if record_format is None:
670693
raise ValueError("Record format must be specified for kinesis source")
671694

sdk/python/feast/infra/offline_stores/bigquery_source.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
@typechecked
2323
class BigQuerySource(DataSource):
24+
"""A BigQuerySource object defines a data source that a BigQueryOfflineStore class can use."""
25+
2426
def __init__(
2527
self,
2628
*,

sdk/python/feast/infra/offline_stores/contrib/mssql_offline_store/mssqlserver_source.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ def to_proto(self) -> DataSourceProto.CustomSourceOptions:
111111

112112

113113
class MsSqlServerSource(DataSource):
114+
"""A MsSqlServerSource object defines a data source that a MsSqlServerOfflineStore class can use."""
115+
114116
def __init__(
115117
self,
116118
name: str,
@@ -124,6 +126,23 @@ def __init__(
124126
tags: Optional[Dict[str, str]] = None,
125127
owner: Optional[str] = None,
126128
):
129+
"""Creates a MsSqlServerSource object.
130+
131+
Args:
132+
name: Name of the source, which should be unique within a project.
133+
table_ref: The table reference.
134+
event_timestamp_column: The event timestamp column (used for point-in-time joins of feature values).
135+
created_timestamp_column: Timestamp column indicating when the row was created
136+
(used for deduplicating rows).
137+
field_mapping: A dictionary mapping of column names in this data
138+
source to feature names in a feature table or view.
139+
Only used for feature columns, not entity or timestamp columns.
140+
date_partition_column: The date partition column.
141+
connection_str: The connection string.
142+
description: A human-readable description.
143+
tags: A dictionary of key-value pairs to store arbitrary metadata.
144+
owner: The owner of the data source, typically the email of the primary maintainer.
145+
"""
127146
# warnings.warn(
128147
# "The Azure Synapse + Azure SQL data source is an experimental feature in alpha development. "
129148
# "Some functionality may still be unstable so functionality can change in the future.",

sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres_source.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
@typechecked
2020
class PostgreSQLSource(DataSource):
21+
"""A PostgreSQLSource object defines a data source that a PostgreSQLOfflineStore class can use."""
22+
2123
def __init__(
2224
self,
2325
name: Optional[str] = None,
@@ -30,6 +32,24 @@ def __init__(
3032
tags: Optional[Dict[str, str]] = None,
3133
owner: Optional[str] = "",
3234
):
35+
"""Creates a PostgreSQLSource object.
36+
37+
Args:
38+
name: Name of PostgreSQLSource, which should be unique within a project.
39+
query: SQL query that will be used to fetch the data.
40+
table: Table name.
41+
timestamp_field (optional): Event timestamp field used for point-in-time joins of
42+
feature values.
43+
created_timestamp_column (optional): Timestamp column indicating when the row
44+
was created, used for deduplicating rows.
45+
field_mapping (optional): A dictionary mapping of column names in this data
46+
source to feature names in a feature table or view. Only used for feature
47+
columns, not entity or timestamp columns.
48+
description (optional): A human-readable description.
49+
tags (optional): A dictionary of key-value pairs to store arbitrary metadata.
50+
owner (optional): The owner of the data source, typically the email of the primary
51+
maintainer.
52+
"""
3353
self._postgres_options = PostgreSQLOptions(name=name, query=query, table=table)
3454

3555
# If no name, use the table as the default name.

sdk/python/feast/infra/offline_stores/contrib/trino_offline_store/trino_source.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def to_proto(self) -> DataSourceProto.TrinoOptions:
8484

8585

8686
class TrinoSource(DataSource):
87+
"""A TrinoSource object defines a data source that a TrinoOfflineStore class can use."""
88+
8789
def __init__(
8890
self,
8991
*,

sdk/python/feast/infra/offline_stores/file_source.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
@typechecked
2828
class FileSource(DataSource):
29+
"""A FileSource object defines a data source that a DaskOfflineStore or DuckDBOfflineStore class can use."""
30+
2931
def __init__(
3032
self,
3133
*,

sdk/python/feast/infra/offline_stores/redshift_source.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
@typechecked
2626
class RedshiftSource(DataSource):
27+
"""A RedshiftSource object defines a data source that a RedshiftOfflineStore class can use."""
28+
2729
def __init__(
2830
self,
2931
*,

sdk/python/feast/infra/offline_stores/snowflake_source.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
@typechecked
2323
class SnowflakeSource(DataSource):
24+
"""A SnowflakeSource object defines a data source that a SnowflakeOfflineStore class can use."""
25+
2426
def __init__(
2527
self,
2628
*,

0 commit comments

Comments
 (0)