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

Added kwargs to ds_get to be passed to panda's read_csv. #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions pydomo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def ds_meta(self, dataset_id):
def ds_delete(self, dataset_id, prompt_before_delete=True):
"""
Delete a DataSet naming convention equivalent with rdomo

:Parameters:
- `dataset_id`: id of a dataset (str)
"""
Expand Down Expand Up @@ -176,7 +176,7 @@ def ds_query(self, dataset_id, query, return_data=True):
return output


def ds_get(self, dataset_id):
def ds_get(self, dataset_id, **kwargs):
"""
Export data to pandas Dataframe

Expand All @@ -185,14 +185,16 @@ def ds_get(self, dataset_id):

:Parameters:
- `dataset_id`: id of a dataset (str)
- `**kwargs`: additional keyword arguments to be passed to read_csv


:Returns:
pandas dataframe
"""
csv_download = self.datasets.data_export(dataset_id, include_csv_header=True)

content = StringIO(csv_download)
df = read_csv(content)
df = read_csv(content, **kwargs)

# Convert to dates or datetimes if possible
for col in df.columns:
Expand Down