Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Avoid unnecessary dependency on sqlalchemy #1455

Merged
merged 2 commits into from
Dec 24, 2022

Conversation

bemoody
Copy link

@bemoody bemoody commented Dec 20, 2022

sqlite/import.py provides a quick and easy way to import MIMIC-IV into SQLite format. As far as I can see, there's no reason for this script to be dependent on sqlalchemy.

(I'd remove the pandas dependency too, but pandas is actually serving a purpose here by auto-detecting some of the column types.)

Granted, I haven't actually used sqlalchemy and I don't know if it provides any special benefits here. I also only tested this on the demo (https://physionet.org/content/mimic-iv-demo/1.0/). Let me know if you want me to do more extensive testing.

It's a minor thing, but it's nice to have one fewer dependency to worry about.

Benjamin Moody and others added 2 commits December 20, 2022 14:45
To import MIMIC-IV into SQLite, import.py uses Pandas both to parse
each data file (read_csv) and then to push the data into an SQL
database (to_sql).

The latter step can use an SQLAlchemy database connection for full
generality (which might be useful sometimes), but it can also simply
use an sqlite3.Connection created by the Python standard library.

Since this script is solely aimed at providing an easy way to get the
data into SQLite format, it's nice to avoid unnecessary dependencies.
@alistairewj alistairewj self-assigned this Dec 24, 2022
Copy link
Member

@alistairewj alistairewj left a comment

Choose a reason for hiding this comment

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

Looks good - I added a GitHub action to test the build too.

@alistairewj alistairewj merged commit 0f89822 into main Dec 24, 2022
@alistairewj alistairewj deleted the bm/m4-sqlite-no-sqlalchemy branch December 24, 2022 03:11
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants