From 63dd3117a87e7fb33de0be732b3de6dce6b49e50 Mon Sep 17 00:00:00 2001 From: Angelika Tarnawa Date: Mon, 2 Oct 2023 15:16:13 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=93=9D=20updated=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- viadot/tasks/cloud_for_customers.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/viadot/tasks/cloud_for_customers.py b/viadot/tasks/cloud_for_customers.py index 09dc399b9..3762a524e 100644 --- a/viadot/tasks/cloud_for_customers.py +++ b/viadot/tasks/cloud_for_customers.py @@ -159,9 +159,9 @@ def run( vault_name: str = None, ): """ - Task for downloading data from the Cloud for Customers to a pandas DataFrame using normal URL (with query parameters). - This task grab data from table from 'scratch' with passing table name in url or endpoint. It is rocommended to add - some filters parameters in this case. + Task for downloading data from the Cloud for Customers to a pandas DataFrame using URL (with query parameters). + Data is obtained from table by passing table name in the url or endpoint. It is recommended to add filters + parameters in this case. Example: url = "https://mysource.com/sap/c4c/odata/v1/c4codataapi" @@ -169,11 +169,11 @@ def run( params = {"$filter": "CreationDateTime ge 2021-12-21T00:00:00Z"} Args: - url (str, optional): The url to the API in case of prepared report. Defaults to None. - env (str, optional): The environment to use. Defaults to 'QA'. + url (str, optional): The url to the API used in case of prepared report. Defaults to None. + env (str, optional): The environment to use to obtain credentials. Defaults to 'QA'. endpoint (str, optional): The endpoint of the API. Defaults to None. fields (List[str], optional): The C4C Table fields. Defaults to None. - params (Dict[str, str]): Query parameters. Defaults to $format=json. + params (Dict[str, str]): Query parameters. Defaults to None. chunksize (int, optional): How many rows to retrieve from C4C at a time. Uses a server-side cursor. if_empty (str, optional): What to do if query returns no data. Defaults to "warn". credentials_secret (str, optional): The name of the Azure Key Vault secret containing a dictionary @@ -211,7 +211,9 @@ def run( def _generate_chunks() -> Generator[pd.DataFrame, None, None]: """ - Util returning chunks as a generator to save memory. + Util function returning chunks. + + Returns: Generator[pd.DataFrame, None, None] """ offset = 0 total_record_count = 0 From 66be264a523136fd66969639a71a22454df7ad28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ziemianek?= <49795849+Rafalz13@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:02:37 +0200 Subject: [PATCH 2/2] Update viadot/tasks/cloud_for_customers.py --- viadot/tasks/cloud_for_customers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viadot/tasks/cloud_for_customers.py b/viadot/tasks/cloud_for_customers.py index 3762a524e..6e1ca6b9a 100644 --- a/viadot/tasks/cloud_for_customers.py +++ b/viadot/tasks/cloud_for_customers.py @@ -174,7 +174,7 @@ def run( endpoint (str, optional): The endpoint of the API. Defaults to None. fields (List[str], optional): The C4C Table fields. Defaults to None. params (Dict[str, str]): Query parameters. Defaults to None. - chunksize (int, optional): How many rows to retrieve from C4C at a time. Uses a server-side cursor. + chunksize (int, optional): How many rows to retrieve from C4C at a time. Uses a server-side cursor. Defaults to None. if_empty (str, optional): What to do if query returns no data. Defaults to "warn". credentials_secret (str, optional): The name of the Azure Key Vault secret containing a dictionary with C4C credentials. Defaults to None.