astronomer / astronomer-cosmos

Run your dbt Core projects as Apache Airflow DAGs and Task Groups with a few lines of code
https://astronomer.github.io/astronomer-cosmos/
Apache License 2.0
596 stars 152 forks source link

[Bug] profile config var `printer_width` shouldn't be an boolean #1187

Open anai-s opened 2 weeks ago

anai-s commented 2 weeks ago

Astronomer Cosmos Version

Other Astronomer Cosmos version (please specify below)

If "Other Astronomer Cosmos version" selected, which one?

1.6.0

dbt-core version

1.7.18

Versions of dbt adapters

1.4.0

LoadMode

DBT_LS_MANIFEST

ExecutionMode

LOCAL

InvocationMode

DBT_RUNNER

airflow version

2.9.1

Operating System

Windows 10

If a you think it's an UI issue, what browsers are you seeing the problem on?

No response

Deployment

Google Cloud Composer

Deployment details

according to dbt documentation, profile config var printer_width should be an int and not a boolean.

What happened?

Invalid unput if I put a int as a value

Relevant log output

No response

How to reproduce

https://github.com/astronomer/astronomer-cosmos/issues/new?assignees=&labels=bug%2Ctriage-needed&projects=&template=01-bug.yml&title=%5BBug%5D+

Anything else :)?

No response

Are you willing to submit PR?

Contact Details

anais.egn@hotmail.fr

dosubot[bot] commented 2 weeks ago

The issue with the printer_width configuration variable in Astronomer Cosmos version 1.6.0 is due to an incorrect type definition in the DbtProfileConfigVars class. The variable is currently defined as Optional[bool] instead of Optional[int], which causes an invalid input error when an integer is provided.

To resolve this, the printer_width should be defined as Optional[int] in the DbtProfileConfigVars class. Here is the relevant part of the code that needs to be updated:

@dataclasses.dataclass
class DbtProfileConfigVars:
    send_anonymous_usage_stats: Optional[bool] = False
    partial_parse: Optional[bool] = None
    use_experimental_parser: Optional[bool] = None
    static_parser: Optional[bool] = None
    printer_width: Optional[int] = None  # Correct type definition
    write_json: Optional[bool] = None
    warn_error: Optional[bool] = None
    warn_error_options: Optional[Dict[Literal["include", "exclude"], Any]] = None
    log_format: Optional[Literal["text", "json", "default"]] = None
    debug: Optional[bool] = None
    version_check: Optional[bool] = None

This change will align the type definition with the expected integer type as per the dbt documentation [1].

To continue talking to Dosu, mention @dosu.