Skip to content
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

Mongo :: instantiate MongoClient with kwargs instead of building a connection string #120

Merged
merged 7 commits into from
Nov 13, 2019

Conversation

piotch
Copy link
Contributor

@piotch piotch commented Nov 7, 2019

Instantiate MongoClient with kwargs rather than with a connection string built from the connector parameters.

It means that it will be easier to add any supported MongoClient kwargs at the MongoConnector level.

It also means that we can use a connection string in the host field and leave out all the other parameters. In the end we can natively support a lot more connections options than we cover with the few parameters that we have explicitly listed in MongoConnector. cf. https://docs.mongodb.com/manual/reference/connection-string/

And more specifically this means that when you create a new MongoDB Atlas cluster, you can just copy and paste the connection string that is given by Atlas into our configurations files.

@codecov-io
Copy link

codecov-io commented Nov 8, 2019

Codecov Report

Merging #120 into master will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #120      +/-   ##
==========================================
- Coverage   98.29%   98.23%   -0.06%     
==========================================
  Files          33       33              
  Lines        1759     1758       -1     
==========================================
- Hits         1729     1727       -2     
- Misses         30       31       +1
Impacted Files Coverage Δ
toucan_connectors/mongo/mongo_connector.py 99.37% <100%> (-0.63%) ⬇️

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 30eb0dd...9afd78e. Read the comment docs.

@@ -305,7 +304,7 @@ def test_status_bad_host(mongo_connector):
('Host connection', None),
('Authenticated', None),
]
assert 'not known' in status['error']
assert len(status['error']) > 0
Copy link
Member

Choose a reason for hiding this comment

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

Pourquoi avoir changé ce test ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

le message d'erreur qui est renvoyé dépends de configurations système, et ne contient pas toujours la string "not known"

@piotch piotch changed the title Mongo :: Use MongoClient parameters instead of re-building a URI Mongo :: instantiate MongoClient with kwargs instead of re-building a connection string Nov 9, 2019
@piotch piotch changed the title Mongo :: instantiate MongoClient with kwargs instead of re-building a connection string Mongo :: instantiate MongoClient with kwargs instead of calculating a connection string Nov 9, 2019
@piotch piotch changed the title Mongo :: instantiate MongoClient with kwargs instead of calculating a connection string Mongo :: instantiate MongoClient with kwargs instead of building a connection string Nov 9, 2019
@davinov davinov merged commit ca4b1f7 into master Nov 13, 2019
@davinov davinov deleted the mongo-client-connexion branch November 13, 2019 13:29
fspot added a commit that referenced this pull request Aug 17, 2020
@fspot fspot mentioned this pull request Aug 17, 2020
fspot added a commit that referenced this pull request Aug 17, 2020
* unpin urllib3 (which was pinned in #120) to avoid conflicts in Toucan api with responses 0.10.16

* bump version number
raphaelvignes pushed a commit that referenced this pull request Jan 12, 2022
DataSet type is defined as two properties:

- `headers`: a list of objects defining columns
  - each column is itself defined by a `name` and
    an optional `type`. We'll probably add extra
    metadata later,

- `data`: a list of list of values

Use this type in the `DataViewer` component.

Related to ToucanToco/weaverbird#26
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.

4 participants