Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@JayH5 I've been thinking about this kind of things:
We did it for GraphQL, but we are in a pre-stable version, so in theory we can be aggressive and remove without adding warnings 🤔
Otherwise, we should be consistent.
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.
I think the whole idea is to shy away from using
get_env
direcrly. We can change the warning to encourage usingtemplates.env
instead oftemplates.get_env()
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.
We definitely wouldn't want to suggest using a private method. We could say
[...] Use the env attribute instead
but even that is not equivalent toget_env
.If we wanted to be really careful we could rename this method to
create_env
and then call it fromget_env
with a warning like "this is deprecated, you probably want the env attribute, but if not use create_env". But, IMO, people should basically never want whatget_env
currently does and it's only confusing. I agree it should be removed.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.
Yeah, I agree! I've copied the warning from another snippet. 😛
But my intention here was to bring the discussion if we should keep adding warnings in pre-1.0.