AttributeError: module 'dbt.flags' has no attribute 'PROFILES_DIR'

We maintain a SQL linter library called SqlFluff, but many users are complaining that it breaks on the latest version of dbt: AttributeError: module 'dbt.flags' has no attribute 'PROFILES_DIR' with dbt 1.5 · Issue #4841 · sqlfluff/sqlfluff · GitHub

Any way to patch the below code?
AttributeError: module 'dbt.flags' has no attribute 'PROFILES_DIR'

from dbt import flags

dbt_profiles_dir = os.path.abspath(
            os.path.expanduser(
                self.sqlfluff_config.get_section(
                    (self.templater_selector, self.name, "profiles_dir")
                )
                or flags.PROFILES_DIR
            )
        )
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.