Skip to content

What should be returned when trying to get a config in invalid format? #3505

@HaoYang670

Description

@HaoYang670

Describe the bug
Currently, when we get a config in invalid format, a default value will be returned. I'm not sure whether this is user-friendly.

To Reproduce
Steps to reproduce the behavior:

    #[test]
    fn get_config_in_invalid_format() {
        let config = ConfigOptions::new();
        let key = "datafusion.execution.batch_size";
        // this is great
        assert!(config.get(key).is_some());
        assert_eq!(8192, config.get_u64(key));

        // these are weird
        assert_eq!(false, config.get_bool(key));
        assert_eq!("", config.get_string(key));
    }

Expected behavior
Personally, I'd like the Datafusion to give some more precise information, for example returning None or an error message.

Additional context
This is related to #3500.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions