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

Add SQLite mixed-type data handling capabilities #50

Merged
merged 54 commits into from
Jul 7, 2023

Conversation

d33bs
Copy link
Member

@d33bs d33bs commented May 9, 2023

Description

This change seeks to address #38 through dynamic handling of mixed-type SQLite column data when exceptions of this kind are encountered with DuckDB SQLite queries.

When mixed type exceptions are encountered, the design intent here strives to keep as much data as possible while assuming one or many values of mismatching type within the SQLite table being queried. SQLite3 SQL case statements are formed to convert mismatched storage class values to NULL's for every column in the table being queried. These SQLite NULL's are interpreted by sqlite3 as Python None's, which are then interpreted as pyarrow.null()'s for export to Parquet.

For SQLite data sources where mixed typing exceptions are not encountered, the default capabilities through DuckDB function as usual.

What is the nature of your change?

  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • This change requires a documentation update.

Checklist

Please ensure that all boxes are checked before indicating that a pull request is ready for review.

  • I have read the CONTRIBUTING.md guidelines.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have deleted all non-relevant text in this pull request template.

@d33bs d33bs marked this pull request as ready for review May 15, 2023 18:05
@d33bs d33bs requested review from falquaddoomi and gwaybio May 15, 2023 18:05
Copy link
Collaborator

@falquaddoomi falquaddoomi left a comment

Choose a reason for hiding this comment

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

Looking good; I left a couple of comments. Cool to see you making the tool more robust.

cytotable/convert.py Show resolved Hide resolved
cytotable/utils.py Outdated Show resolved Hide resolved
cytotable/utils.py Show resolved Hide resolved
tests/test_convert.py Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
@gwaybio
Copy link
Member

gwaybio commented Jul 7, 2023

@falquaddoomi @d33bs - is this ready to merge? Will it solve #38? (@jenna-tomkinson and @MattsonCam are currently blocked by it for the JUMP single cell analysis)

@gwaybio
Copy link
Member

gwaybio commented Jul 7, 2023

Update, @d33bs - just saw your comment in #38 (comment)

Copy link
Member

@gwaybio gwaybio left a comment

Choose a reason for hiding this comment

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

LGTM! Excited to get this merged in.

@gwaybio gwaybio merged commit e41256f into cytomining:main Jul 7, 2023
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.

3 participants