Skip to content

Commit

Permalink
Merge pull request #754 from angelika233/c4c_docstring
Browse files Browse the repository at this point in the history
📝 updated documentation
  • Loading branch information
Rafalz13 authored Oct 11, 2023
2 parents c0536e7 + 66be264 commit c7d917d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions viadot/tasks/cloud_for_customers.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,22 @@ 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"
endpoint = "ServiceRequestCollection"
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.
chunksize (int, optional): How many rows to retrieve from C4C at a time. Uses a server-side cursor.
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. 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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c7d917d

Please sign in to comment.