From 6bff223ffe10cd85e5aa23ac13883b52168d8d8d Mon Sep 17 00:00:00 2001 From: Kristen Lavavej <35638702+klavavej@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:11:58 -0800 Subject: [PATCH] [DOCS] replace `context.sources` with `context.data_sources` (#10794) Co-authored-by: Bill Dirks --- .../sql_data/_create_a_data_source/_create_a_data_source.md | 2 +- docs/docusaurus/docs/reference/learn/migration_guide.md | 2 +- .../data_context/data_context/abstract_data_context.py | 2 +- great_expectations/datasource/fluent/interfaces.py | 2 +- great_expectations/datasource/fluent/sources.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docusaurus/docs/core/connect_to_data/sql_data/_create_a_data_source/_create_a_data_source.md b/docs/docusaurus/docs/core/connect_to_data/sql_data/_create_a_data_source/_create_a_data_source.md index 9388f048475f..d6fa9ca11b18 100644 --- a/docs/docusaurus/docs/core/connect_to_data/sql_data/_create_a_data_source/_create_a_data_source.md +++ b/docs/docusaurus/docs/core/connect_to_data/sql_data/_create_a_data_source/_create_a_data_source.md @@ -70,7 +70,7 @@ import DatasourceMethodReferenceTable from './_datasource_method_reference_table "schema": "my_schema" } - data_source = context.sources.add_snowflake( + data_source = context.data_sources.add_snowflake( name=datasource_name, connection_string=connection_details, kwargs={"connect_args": connect_args} diff --git a/docs/docusaurus/docs/reference/learn/migration_guide.md b/docs/docusaurus/docs/reference/learn/migration_guide.md index 2301aeb059b5..7627f16b8ec5 100644 --- a/docs/docusaurus/docs/reference/learn/migration_guide.md +++ b/docs/docusaurus/docs/reference/learn/migration_guide.md @@ -673,7 +673,7 @@ A few configurations are **NO LONGER SUPPORTED**: ```python title="Python" # Create datasource connection_string = "snowflake://:@//?warehouse=&role=" - snowflake_ds = context.sources.add_snowflake(name="snowflake_ds", connection_string=connection_string) + snowflake_ds = context.data_sources.add_snowflake(name="snowflake_ds", connection_string=connection_string) # Create table asset and batch definitions table_asset = snowflake_ds.add_table_asset(name="taxi_data", table_name="TAXI_DATA_ALL_SAMPLES") diff --git a/great_expectations/data_context/data_context/abstract_data_context.py b/great_expectations/data_context/data_context/abstract_data_context.py index fa1df99c61d6..91d0df757c95 100644 --- a/great_expectations/data_context/data_context/abstract_data_context.py +++ b/great_expectations/data_context/data_context/abstract_data_context.py @@ -702,7 +702,7 @@ def _validate_add_datasource_args( # "type" is only used in FDS so we check for its existence (equivalent for block-style would be "class_name" and "module_name") # noqa: E501 if "type" in kwargs: raise TypeError( # noqa: TRY003 - "Creation of fluent-datasources with individual arguments is not supported and should be done through the `context.sources` API." # noqa: E501 + "Creation of fluent-datasources with individual arguments is not supported and should be done through the `context.data_sources` API." # noqa: E501 ) def _add_datasource( diff --git a/great_expectations/datasource/fluent/interfaces.py b/great_expectations/datasource/fluent/interfaces.py index b276e280cdf2..e605b336b432 100644 --- a/great_expectations/datasource/fluent/interfaces.py +++ b/great_expectations/datasource/fluent/interfaces.py @@ -216,7 +216,7 @@ class GxContextWarning(GxDatasourceWarning): """ Warning related to a Datasource with a missing context. Usually because the Datasource was created directly rather than using a - `context.sources` factory method. + `context.data_sources` factory method. """ diff --git a/great_expectations/datasource/fluent/sources.py b/great_expectations/datasource/fluent/sources.py index eea2dc4fed5a..e51990341eb1 100644 --- a/great_expectations/datasource/fluent/sources.py +++ b/great_expectations/datasource/fluent/sources.py @@ -112,7 +112,7 @@ def register_datasource(cls, ds_type: Type[Datasource]) -> None: Example ------- - An `.add_pandas_filesystem()` pandas_filesystem factory method will be added to `context.sources`. + An `.add_pandas_filesystem()` pandas_filesystem factory method will be added to `context.data_sources`. >>> class PandasFilesystemDatasource(_PandasFilePathDatasource): >>> type: str = 'pandas_filesystem'