Skip to content

Remove ensure_file from recommended practice for downstream libraries - #9171

Merged
mrocklin merged 1 commit into
dask:mainfrom
mrocklin:dont-ensure-file
Jun 10, 2022
Merged

mrocklin merged 1 commit into
dask:mainfrom
mrocklin:dont-ensure-file

Conversation

@mrocklin

@mrocklin mrocklin commented Jun 8, 2022

Copy link
Copy Markdown
Member

Previously we did this to educate users about possible configuration.
But as configuration shifts really all this means is that there's lots
of stale config files lying around.

Historically we've found that it's better not to copy these.
We've been doing this in Dask libraries for some time now.
This change just changes the recommendations in the documentation.

cc @ntabris

Previously we did this to educate users about possible configuration.
But as configuration shifts really all this means is that there's lots
of stale config files lying around.

Historically we've found that it's better not to copy these.
We've been doing this in Dask libraries for some time now.
This change just changes the recommendations in the documentation.
@github-actions github-actions Bot added the documentation Improve or add to documentation label Jun 8, 2022
@mrocklin

mrocklin commented Jun 8, 2022

Copy link
Copy Markdown
Member Author

Merging tomorrow if there are no further comments.

@jrbourbeau jrbourbeau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Historically we've found that it's better not to copy these.
We've been doing this in Dask libraries for some time now.

FWIW this seems to be true for distributed but not other projects like dask-cloudprovider, dask-jobqueue, and dask-kubernetes. They're still all using ensure_file

IIUC this means ensure_file is no longer being used anymore (or not longer recommended for use). If that's the case, I'd like to deprecate and eventually remove ensure_file too

@mrocklin

mrocklin commented Jun 9, 2022

Copy link
Copy Markdown
Member Author

@jrbourbeau is that a blocking comment, or should I go ahead and merge here?

@jrbourbeau

Copy link
Copy Markdown
Member

Not blocking, but if you merge this could you please also open a quick issue about deprecating ensure_file so we don't loose track of it

Also, FWIW I don't 100% understand the motivation for this change (or why we wanted ensure_file in the first place) but trust that you've thought through things

@mrocklin

mrocklin commented Jun 9, 2022

Copy link
Copy Markdown
Member Author

Ensure file is useful. It's not always what you want though. It creates an optionally-commented-out version of the config file in the user's config directory that corresponds to current default, if no such file exists. This is good because it helps people to quickly see what is available to them.

However, this is also somewhat shortsighted. As we change config we leave lots of these files around. Most people don't actually look at the config when they first start. When they do use config they typically only need a little bit of it, not the whole thing. It's been better to not send these things out all the time, freezing people at whatever config file when they first installed the package (possibly years ago)

@mrocklin

mrocklin commented Jun 9, 2022

Copy link
Copy Markdown
Member Author

So I'm not sure that I would go so far as to deprecate it. (it's still a useful function) I would say that we probably shouldn't recommend it any longer, and that we should probably consider removing it from our own projects.

@mrocklin
mrocklin merged commit 07e31d3 into dask:main Jun 10, 2022
@mrocklin
mrocklin deleted the dont-ensure-file branch June 10, 2022 14:10
@mrocklin

Copy link
Copy Markdown
Member Author

Conversation about changing behavior here: #9179

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

Labels

documentation Improve or add to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants