Skip to content

Make it clearer that RuntimeEnv::new() is fallable #12554

@alamb

Description

@alamb

Is your feature request related to a problem or challenge?

While working on https://github.com/datafusion-contrib/datafusion-dft it was not clear that RuntimeEnv::new() actually returns a Result as the typical rust convention is a function new() is infallable and a function like try_new() is fallable. While this isn't a big deal it was a small usability papercut

Describe the solution you'd like

I would like RuntimeEnv to follow standard rust conventions to make it easier to use

Describe alternatives you've considered

I suggest:

  1. Deprecating RuntimeEnv::new()
  2. Add a new function RuntimeEnv::try_new() that does the same thing
  3. Update all the datafusion code to use try_new instead

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions