Comments (3)
It would be even better to be able to configure the npartitions directly rather than the chunksize. The we can remove the duplicate query for the $count. Something like:
# Read Dask Bag from Mongo database
b = dask_mongo.read_mongo(
database="your_database",
collection="your_collection",
connection_kwargs={"host": "localhost", "port": 27017},
npartitions=16,
)
from dask-mongo.
Hey @ShaneHarvey thanks for bringing this to our attention. In general, I agree that specifying npartitions
would be better, but the example in the README is very small and self-contained. Do you think that it would be better to generate a bigger example dask bag at the risk of making the example less concrete and grok-able? Or perhaps we could add comments next to the chunksize
and npartitions
kwargs
from dask-mongo.
Adding an inline comment would be a great start, maybe something like chunksize=2, # Increase this value for better performance.
. I still worry about using a poor default value even if it's a toy example.
Support for the npartitions feature would be a nice addition since I believe it would scale better in most cases. When npartitions is added, we could update the readme to use npartitions=16. Sure, the same problem of using a poor default value exists here (maybe npartitions=4 or npartitions=50 is better for a given query) but I imagine npartitions=16 is much better than chunksize=2 in general.
from dask-mongo.
Related Issues (12)
- Modify demo to use df to bag as dict in `to_mongo` part HOT 1
- ModuleNotFoundError: No module named 'dask.graph_manipulation' HOT 9
- Track appname in MongoClient HOT 11
- Release tracker
- Better error when unable to connect HOT 2
- Coiled runtime that includes dask-mongo? HOT 2
- Upsert to mongo
- Use `HighLevelGraph` layers in `dask-mongo.read_mongo` HOT 4
- Replace name of `read_partition` to include mongo HOT 3
- Release? HOT 2
- Add project parameter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dask-mongo.