Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config values that are octal strings get interpreted parsed as ints #4766

Closed
vmarunov opened this issue Sep 9, 2021 · 2 comments
Closed
Labels
type: bug Something isn't working

Comments

@vmarunov
Copy link

vmarunov commented Sep 9, 2021

Summary

Unexpected type conversion in presets when using Dagit.

Reproduction

Test solid and pipeline:

from dagster import pipeline, solid, PresetDefinition


@solid(config_schema={'data': [str]})
def test_solid(context):
    ...
    return 0


@pipeline(
    name="test_pipeline",
    preset_defs=[
        PresetDefinition(
            name='dev',
            run_config={
                'solids': {
                    'test_solid': {
                        'config': {
                            'data': ['1234', '0148', '1418', '0183', '4567']}
                    }
                }
            },
            solid_selection=None,
            mode='default',
            tags={}
        )
    ]
)
def test_pipeline():
    test_solid()

This behavior reproduce for values, that starts with 0 and contains 8.
This behavior is only in Dagit. Without dagit, the config is read without errors.

Dagit UI/UX Issue Screenshots

image

dagit version == 0.12.9

@vmarunov vmarunov added the type: bug Something isn't working label Sep 9, 2021
@alangenfeld
Copy link
Member

This issue has to do with how the yaml 1.1 spec interprets octal values. They addressed this in the 1.2 version of the spec.
We currently use PyYAML which abides by the 1.1 spec causing these issues.

context: yaml/pyyaml#98

@sryza sryza changed the title dagit wrong type convertion dagit wrong type conversion Sep 30, 2021
@yuhan
Copy link
Contributor

yuhan commented Sep 30, 2021

Closing it as it's less related to Dagster but more related to the third party libs we depend on. Reopen if there's anything we can do.

@yuhan yuhan closed this as completed Sep 30, 2021
@sryza sryza changed the title dagit wrong type conversion config values that are octal strings get interpreted parsed as ints Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants