Add profile_config arg to DbtKubernetesBaseOperator#505
Conversation
👷 Deploy Preview for amazing-pothos-a3bca0 processing.
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #505 +/- ##
==========================================
- Coverage 91.48% 91.30% -0.18%
==========================================
Files 49 49
Lines 1914 1921 +7
==========================================
+ Hits 1751 1754 +3
- Misses 163 167 +4
☔ View full report in Codecov by Sentry. |
**Features** * Support dbt global flags (via dbt_cmd_global_flags in operator_args) by @tatiana in #469 * Support parsing DAGs when there are no connections by @jlaneve in #489 **Enhancements** * Hide sensitive field when using BigQuery keyfile_dict profile mapping by @jbandoro in #471 * Consistent Airflow Dataset URIs, inlets and outlets with `Openlineage package <https://pypi.org/project/openlineage-integration-common/>`_ by @tatiana in #485. `Read more <https://astronomer.github.io/astronomer-cosmos/configuration/lineage.html>`_. * Refactor ``LoadMethod.DBT_LS`` to run from a temporary directory with symbolic links by @tatiana in #488 * Run ``dbt deps`` when using ``LoadMethod.DBT_LS`` by @DanMawdsleyBA in #481 * Update Cosmos log color to purple by @harels in #494 * Change operators to log ``dbt`` commands output as opposed to recording to XCom by @tatiana in #513 **Bug fixes** * Fix bug on select node add exclude selector subset ids logic by @jensenity in #463 * Refactor dbt ls to run from a temporary directory, to avoid Read-only file system errors during DAG parsing, by @tatiana in #414 * Fix profile_config arg in DbtKubernetesBaseOperator by @david-mag in #505 * Fix SnowflakePrivateKeyPemProfileMapping private_key reference by @nacpacheco in #501 * Fix incorrect temporary directory creation in VirtualenvOperator init by @tatiana in #500 * Fix log propagation issue by @tatiana in #498 * Fix PostgresUserPasswordProfileMapping to retrieve port from connection by @jlneve in #511 **Others** * Docs: Fix RenderConfig load argument by @jbandoro in #466 * Enable CI integration tests from external forks by @tatiana in #458 * Improve CI tests runtime by @tatiana in #457 * Change CI to run coverage after tests pass by @tatiana in #461 * Fix forks code revision in code coverage by @tatiana in #472 * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #467 * Drop support to Python 3.7 in the CI test matrix by @harels in #490 * Add Airflow 2.7 to the CI test matrix by @tatiana in #487 * Add MyPy type checks to CI since we exceeded pre-commit disk quota usage by @tatiana in #510
|
Hi @david-mag, @jlaneve, I'm now trying to create a DbtDag with execution_mode='kubernetes'. Even though I don't receive the profile_config error anymore (since the 1.1.0 release), I got a new error: The emit_datasets arg is not something I set on my own. Here's the DbtDag for reference: is this a related issue? |
|
As far as I can see, with the release of this fix, more "unknown" arguments have been added, which broke the kubernetes DAGs and TaskGroups again right away. |
|
@david-mag I also encountered the same problem. If using cosmos on kubernetes, it seems this is a fatal problem. |
Description
When creating
DbtTaskGroups andDbtDags, aProfileConfigneeds to be provided, since it's a required positional argument of theDbtAirflowConverterclass. However, when providing aprofile_configinexecution_mode="kubernetes", the following Exception is thrown:In my humble attempt of a solution, I make the
profile_configan optional argument of theDbtKubernetesBaseOperatorclass (mainly to satisfy the tests ... since its a required argument in the previous part of the "pipeline", having it being a required argument would make sense imho) and parse it inside thebuild_kube_argsmethod (similar, but not identically) to how it is done in therun_commandmethod of theDbtLocalBaseOperatorclass.This solution fixes the thrown exception and has the added benefit of giving the user that want to run dbt inside kubernetes the option to specify
--profileand--target, which is a useful feature when wanting to schedule the same model in airflow, pointing to dev and prod targets.I've tested this solution in my GCC environment.
Related Issue(s)
This PR resolves the issue in issue #493
Breaking Change?
This should fix something that is broken atm, as far as I can see.
Checklist