Skip to content

Feat: Add support for YC managed Airflow#3396

Merged
izeigerman merged 5 commits intoSQLMesh:mainfrom
petrikoro:feat-airflow-support-yc
Nov 21, 2024
Merged

Feat: Add support for YC managed Airflow#3396
izeigerman merged 5 commits intoSQLMesh:mainfrom
petrikoro:feat-airflow-support-yc

Conversation

@petrikoro
Copy link
Contributor

Add Support for YC Managed Airflow

Description

This PR introduces a new configuration for YC Managed Airflow, enabling the use of both username:password credentials and an IAM token for authentication.

Documentation for the YC Managed Airflow: https://yandex.cloud/en/docs/managed-airflow/operations/af-interfaces

Changes Made

  • Added the YCAirflowSchedulerConfig class to support YC Managed Airflow configuration.

@CLAassistant
Copy link

CLAassistant commented Nov 19, 2024

CLA assistant check
All committers have signed the CLA.

@izeigerman
Copy link
Contributor

It appears that the only difference from the vanilla AirflowSchedulerConfig configuration is a different name of the authorization header? Can we instead extend AirflowSchedulerConfig with ability to override it:

class AirflowSchedulerConfig(_BaseAirflowSchedulerConfig, BaseConfig):
    authorization_header_name: str = "Authorization"

It's fine if we still want a custom configuration for YC, but its implementation should become much simpler:

class YCAirflowSchedulerConfig(AirflowSchedulerConfig):
     authorization_header_name: str = "X-Cloud-Authorization"

Also does it need both the token and username / password?

@petrikoro
Copy link
Contributor Author

Yes, both the token and username:password are required, as stated in the documentation: https://yandex.cloud/en/docs/managed-airflow/operations/af-interfaces#rest-api.

This is the primary reason I prefer to implement it as a separate class, rather than modifying the vanilla AirflowSchedulerConfig, since I don't want to override the authentication method (now it's either username:password or a token).

@izeigerman
Copy link
Contributor

@petrikoro any chance you can add a section on YC AIrflow support to https://github.com/TobikoData/sqlmesh/blob/main/docs/integrations/airflow.md?

@petrikoro
Copy link
Contributor Author

@petrikoro any chance you can add a section on YC AIrflow support to https://github.com/TobikoData/sqlmesh/blob/main/docs/integrations/airflow.md?

Updated docs, could you please take a look?


### Yandex Cloud

Yandex Cloud offers [managed Airflow instances](https://yandex.cloud/en/services/managed-airflow), and SQLMesh fully supports Airflow hosted by Yandex Cloud.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the back and forth but it'd be helpful to mention which scheduler type to specify to use this. Eg. here's how we document this for the Cloud Composer: https://github.com/TobikoData/sqlmesh/blob/13cf28ab60972ef043fbe6c65ddc11908f949631/docs/reference/configuration.md#cloud-composer. We can then include a link to the config reference here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Somehow I missed the part about the configuration :D

I added information about the configuration in the latest commit and slightly adjusted the wording in docs/integrations/airflow.md

@izeigerman
Copy link
Contributor

One last comment, should be good to go otherwise.

@izeigerman
Copy link
Contributor

Thanks a lot for addressing comments!

@izeigerman izeigerman merged commit 463932a into SQLMesh:main Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants