Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding MSGraphOperator in Microsoft Azure provider (#38111)
* refactor: Initial commit contains the new MSGraphOperator * refactor: Extracted common method into Base class for patching airflow connection and request adapter + make multiple patches into one context manager Python 3.8 compatible * refactor: Refactored some typing issues related to msgraph * refactor: Added some docstrings and fixed additional typing issues * refactor: Fixed more static checks * refactor: Added license on top of test serializer and fixed import * Revert "refactor: Added license on top of test serializer and fixed import" This reverts commit 04d6b85. * refactor: Added license on top of serializer files and fixed additional static checks * refactor: Added new line at end of json test files * refactor: Try fixing docstrings on operator and serializer * refactor: Replaced NoneType with None * refactor: Made type unions Python 3.8 compatible * refactor: Reformatted some files to comply with static checks formatting * refactor: Reformatted base to comply with static checks formatting * refactor: Added msgraph-core dependency to provider.yaml * refactor: Added msgraph integration info to provider.yaml * refactor: Added init in resources * fix: Fixed typing of response_handler * refactor: Added assertions on conn_id, tenant_id, client_id and client_secret * refactor: Fixed some static checks * Revert "refactor: Added assertions on conn_id, tenant_id, client_id and client_secret" This reverts commit 88aa7dc. * refactor: Changed imports in hook as we don't use mockito anymore we don't need the module before constructor * refactor: Renamed test methods * refactor: Replace List type with list * refactor: Moved docstring as one line * refactor: Fixed typing for tests and added test for response_handler * refactor: Refactored tests * fix: Fixed MS Graph logo filename * refactor: Fixed additional static checks remarks * refactor: Added white line in type checking block * refactor: Added msgraph-core dependency to provider_dependencies.json * refactor: Updated docstring on response handler * refactor: Moved ResponseHandler and Serializer to triggers module * docs: Added documentation on how to use the MSGraphAsyncOperator * docs: Fixed END tag in examples * refactor: Removed docstring from CallableResponseHandler * refactor: Ignore UP031 Use format specifiers instead of percent format as this is not possible here the way the DAG is evaluated in Airflow (due to XCom's) * Revert "refactor: Removed docstring from CallableResponseHandler" This reverts commit 6a14ebe. * refactor: Simplified docstring on CallableResponseHandler * refactor: Updated provider.yaml to add reference of msgraph to how-to-guide * refactor: Updated docstrings on operator and trigger * refactor: Fixed additional static checks * refactor: Ignore UP031 Use format specifiers instead of percent format as this is not possible here the way the DAG is evaluated in Airflow (due to XCom's) * refactor: Added param to docstring ResponseHandler * refactor: Updated pyproject.toml as main * refactor: Reformatted docstrings in trigger * refactor: Removed unused serialization module * fix: Fixed execution of consecutive tasks in execute_operator method * refactor: Added customizable pagination_function parameter to Operator and made operator PowerBI compatible * refactor: Reformatted operator and trigger * refactor: Added check if query_parameters is not None * refactor: Removed typing of top and odata_count * refactor: Ignore type for tenant_id (this is an issue in the ClientSecretCredential class) * refactor: Changed docstring on MSGraphTrigger * refactor: Changed docstring on MSGraphTrigger * refactor: Added docstring to handle_response_async method * refactor: Fixed docstring to imperative for handle_response_async method * refactor: Try quoting Sharepoint so it doesn't get spell checked * refactor: Try double quoting Sharepoint so it doesn't get spell checked * refactor: Always get a new event loop and close it after test is done * refactor: Reordered imports from contextlib * refactor: Added Sharepoint to spelling_wordlist.txt * refactor: Removed connection-type for KiotaRequestAdapterHook * refactor: Refactored encoded_query_parameters * refactor: Suppress ImportError * refactor: Added return type to paginate method * refactor: Updated paging_function type in MSGraphAsyncOperator * refactor: Pass the method name from method reference instead of hard coded string which is re-factor friendly * refactor: Changed return type of paginate method * refactor: Added MSGraphSensor which easily allows us to poll PowerBI statuses * refactor: Moved BytesIO and Context to type checking block for MSGraphSensor * refactor: Added noqa check on pull_execute_complete method of MSGraphOperator * fix: Fixed test_serialize of TestMSGraphTrigger * refactor: Added docstring to MSGraphSensor and updated the docstring of the MSGraphAsyncOperator * refactor: Reformatted docstring of MSGraphSensor * refactor: Added white line at end of status.json file to keep static check happy * refactor: Removed timeout parameter from constructor MSGraphSensor as it is already defined in the BaseSensorOperator * fix: Added missing return for async_poke in MSGraphSensor * Revert "refactor: Added noqa check on pull_execute_complete method of MSGraphOperator" This reverts commit ca6f92c. * refactor: Reorganised imports on MSGraphSensor * refactor: Reformatted TestMSGraphSensor * refactor: Added MSGraph sensor integration name in provider.yaml * refactor: Updated apache-airflow version to at least 2.7.0 in provider.yaml of microsoft-azure provider * refactor: Exclude microsoft-azure from compatibility check with airflow 2.6.0 as version 2.7.0 will at least be required * refactor: Also updated the apache-airflow dependency version from 2.6.0 to 2.7.0 for microsoft-azure provider in provider_dependencies.json * refactor: Reformatted global_constants.py * refactor: Add logging statements for proxies and authority related stuff * fix: Fixed exclusion of microsoft.azure dependency in global_constants.py * refactor: Some Azure related imports should be ignored when running Airflow 2.6.0 or lower * refactor: Import of ADLSListOperator should be ignored when running Airflow 2.6.0 or lower * refactor: Moved optional provider imports that should be ignored when running Airflow 2.6.0 or lower at top of file * refactor: Fixed the event loop closed issue when executing long running tests on the MSGraphOperator * refactor: Extracted reusable mock_context method * refactor: Moved import of Session into type checking block * refactor: Updated the TestMSGraphSensor * refactor: Reformatted the mock_context method * refactor: Try implementing cached connections on MSGraphTrigger * docs: Added example for the MSGraphSensor and additional examples on how you can use the operator for PowerBI * Revert "refactor: Try implementing cached connections on MSGraphTrigger" This reverts commit 693975e. * fix: Fixed serialization of event payload as xcom_value for the MSGraphSensor * refactor: TestMSGraphAsyncOperator should be allowed to run as a db test * Revert "refactor: TestMSGraphAsyncOperator should be allowed to run as a db test" This reverts commit c7a06db. * refactor: TestMSGraphAsyncOperator should be allowed to run as a db test * refactor: Also added result_processor to MSGraphSensor * refactor: Fixed template_fields in operator, trigger and sensor --------- Co-authored-by: David Blain <[email protected]>
- Loading branch information