LBNL-ETA / Adapter

The Adapter software is developed at the Energy Efficiency Standards Department and it provides a convenient data table loader from various formats such as xlsx, csv, db (sqlite database), and sqlalchemy. Its main feature is the ability to convert data tables identified in one main and optionally one or more additional input files into database tables and Pandas DataFrames for downstream usage in any compatible software.
1 stars 1 forks source link

All keys are being checked for in the pre-existing keys, instead of just the table names that need to be read #17

Closed a-sharma06 closed 2 years ago

a-sharma06 commented 2 years ago

In the load function of class Db, duplicates of keys are being checked for. https://github.com/LBNL-ETA/Adapter/blob/master/adapter/to_python.py#L283

However, the docstring indicates that only table_names will be read from the database. Therefore, only duplicates of table_names should be checked for.

For reference, this issue didn't exist in v1.2.1.

a-sharma06 commented 2 years ago

@lyralan @milicag @0xd5dc

milicag commented 2 years ago

@a-sharma06 Thanks for identifying and reporting the issue. @lyralan Is this something you can tackle? It looks like it could be a simple fix.

lyralan commented 2 years ago

@milicag It should be an easy fix, and I can make edits accordingly.

BTW, the PR that @a-sharma06 found for to_python.Db has a version number v1.2.2. However, I didn't see a tag for v.1.2.2 when I made commits for to_python.Excel, which should not be related to this issue.

lyralan commented 2 years ago

I'm going to add a test for this case as well.