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

📝 updated documentation #754

Merged
merged 2 commits into from
Oct 11, 2023
Merged
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
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
Loading