Skip to content

Fixes #669 -- Load favorites queries from and save to --myclirc#697

Merged
amjith merged 4 commits intomasterfrom
mdsrosa/fix-favorite-queries-not-loaded
Dec 13, 2018
Merged

Fixes #669 -- Load favorites queries from and save to --myclirc#697
amjith merged 4 commits intomasterfrom
mdsrosa/fix-favorite-queries-not-loaded

Conversation

@mdsrosa
Copy link
Contributor

@mdsrosa mdsrosa commented Dec 11, 2018

Description

Favorite queries were being loaded from and save to the default configuration file (~/.myclirc) only. This PR fixes that issue by making sure that FavoriteQueries instance is created with the config loaded from --myclirc argument.

Fixes #669.

Checklist

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).

@mdsrosa mdsrosa requested review from amjith and tsroten December 11, 2018 18:47
@mdsrosa mdsrosa changed the title Fixes #669 -- Load/store favorites queries from/in --myclirc Fixes #669 -- Load favorites queries from and save to --myclirc Dec 11, 2018
@mdsrosa mdsrosa force-pushed the mdsrosa/fix-favorite-queries-not-loaded branch from f7d7978 to be7d1f5 Compare December 11, 2018 21:58
@codecov-io
Copy link

codecov-io commented Dec 11, 2018

Codecov Report

Merging #697 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #697      +/-   ##
==========================================
- Coverage   77.96%   77.96%   -0.01%     
==========================================
  Files          25       25              
  Lines        2383     2387       +4     
==========================================
+ Hits         1858     1861       +3     
- Misses        525      526       +1
Impacted Files Coverage Δ
mycli/packages/special/iocommands.py 88.93% <100%> (+0.17%) ⬆️
mycli/packages/special/favoritequeries.py 86.95% <100%> (-4.72%) ⬇️
mycli/sqlcompleter.py 88.74% <100%> (ø) ⬆️
mycli/main.py 76.4% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9f19cd...a93cd23. Read the comment docs.

fuzzy=False)
completions.extend(special)
elif suggestion['type'] == 'favoritequery':
from .packages.special.iocommands import favoritequeries
Copy link
Member

Choose a reason for hiding this comment

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

Can you help me understand why this import statement is inside this elif clause instead of at the top of the file?

Copy link
Contributor Author

@mdsrosa mdsrosa Dec 12, 2018

Choose a reason for hiding this comment

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

@amjith Leftovers of testing/debugging. I've moved it back to the top of the file where it belongs. Good catch! 🙂

@amjith
Copy link
Member

amjith commented Dec 13, 2018

Works great!

Nice work.

@amjith amjith merged commit c9122f9 into master Dec 13, 2018
@amjith amjith deleted the mdsrosa/fix-favorite-queries-not-loaded branch December 13, 2018 00:56
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.

Favorite queries not loaded from or saved to config file

3 participants