-
Notifications
You must be signed in to change notification settings - Fork 310
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 parsing columns when --do-create-db=false #70
Conversation
@RobAtticus Before I write a series of new tests for this, I wanted to make sure this refactor looks like a decent path to go down to you. Basically, I've split the PostCreateDB method into 2 different methods, This makes it easier to make proper use of the |
Yup this looks reasonable to me. Separate from this PR we should try and clean up the global state -- seems to be a bit of a mess to keep track of. |
Definitely agreed on that one @RobAtticus |
90de05f
to
ea361de
Compare
ea361de
to
2e17fe0
Compare
Codecov Report
@@ Coverage Diff @@
## master #70 +/- ##
==========================================
+ Coverage 53.46% 53.93% +0.47%
==========================================
Files 76 76
Lines 3713 3719 +6
==========================================
+ Hits 1985 2006 +21
+ Misses 1706 1690 -16
- Partials 22 23 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #70 +/- ##
==========================================
+ Coverage 53.46% 53.93% +0.47%
==========================================
Files 76 76
Lines 3713 3719 +6
==========================================
+ Hits 1985 2006 +21
+ Misses 1706 1690 -16
- Partials 22 23 +1
Continue to review full report at Codecov.
|
@RobAtticus Added tests. This should be ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, if it's not too much trouble I might just suggest adding one more case for 2 fields indexes. Since we use a special value for all and 1
can sometimes be a special case, just want to make sure something works in the general case.
Not strictly necessary though.
This fixes a bug where the PostCreateDB function would exit early when the user set --do-create-db=false and/or --create-metrics-table=False. This early exit caused TSBS to skip the updating of some global caches, which broke assumptions in other parts of the codebase. This commit also refactors the PostCreateDB function to split the parsing of columns and the potential creation of tables and indexes into separate functions. This makes it easier to test the functions in isolation and cleaner to create the conditional create-table logic that is at the heart of this bug. While this does add tests to the parsing function, the create tables/index function remains untested. This is left for a later PR that will hopefully clean up global state and provide a more comprehensive framework for testing IO.
2e17fe0
to
3f5664d
Compare
Good call @RobAtticus -- done. |
No description provided.