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

fix singer parsing for columns with dtype object #27

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

keyn4
Copy link
Contributor

@keyn4 keyn4 commented Feb 16, 2024

Problem:
The get function assigns dtype "object" to all columns that are of type array or object in the catalog without parsing the data, which creates an stringified invalid json.

Steps to reproduce:
It happens for any css file with columns that have arrays or objects data inside.

Fix:
parse all the columns with dtype object when reading the df.

@@ -519,7 +519,9 @@ def get(self, stream, default=None, catalog_types=False, **kwargs):
if catalog and catalog_types:
types_params = self.get_types_from_catalog(catalog, stream)
kwargs.update(types_params)
return pd.read_csv(filepath, **kwargs)
df = pd.read_csv(filepath, **kwargs)
df = parse_object_cols(df)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's flag this logic (add a param like parse_objects=False)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants