Skip to content
This repository was archived by the owner on Mar 12, 2023. It is now read-only.

WIP: Implement Storage class#39

Open
Sh4pe wants to merge 32 commits intomasterfrom
storage_class
Open

WIP: Implement Storage class#39
Sh4pe wants to merge 32 commits intomasterfrom
storage_class

Conversation

@Sh4pe
Copy link
Copy Markdown
Owner

@Sh4pe Sh4pe commented Feb 10, 2019

Do not review or merge yet. This will heavily change.

  • origin in DataFrames from TextImporter?
  • Unify handling of columns in Textimporter and Database. One definition should be global.
  • Test-Code should be refactored, e.g. TemporaryDatabase
  • Create database subpackage, see WIP new directory structure #47

Closes #30.

This is a first draft that implements this class. It is responsible
to obtain connections to the DB and make sure the expected tables
exist.
Python 2 does not have tempfile.TemporaryDirectory
This class duplicates a Pandas DataFrame into a temporary table
inside a sqlite database. The table is disposed once it is not needed
any more.
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 10, 2019

Codecov Report

Merging #39 into master will decrease coverage by 2.62%.
The diff coverage is 86.63%.

@@            Coverage Diff             @@
##           master      #39      +/-   ##
==========================================
- Coverage   95.66%   93.03%   -2.63%     
==========================================
  Files           9       13       +4     
  Lines         461      646     +185     
==========================================
+ Hits          441      601     +160     
- Misses         20       45      +25
Impacted Files Coverage Δ
pynance/definitions.py 100% <100%> (ø)
pynance/textimporter.py 100% <100%> (ø) ⬆️
pynance/database_test.py 100% <100%> (ø)
unittests.py 31.42% <31.42%> (ø)
pynance/database.py 98.27% <98.27%> (ø)

@Sh4pe Sh4pe mentioned this pull request Feb 11, 2019
This makes it safe in Python 2 as well
The version before failed when it is executed on the same database
twice. Added test to ensure this behaviour is tested and fixed the
bug.
Comment thread pynance/storage_test.py

storage = Storage(self.db_file)
df_cash = self._read_dummy_file_dkbcash_small()
df_visa = self._read_dummy_file_dkbcash_small()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should say self._read_dummy_file_dkbvisa_small()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the Storage class

2 participants