Skip to content

Conversation

@ipeluffo
Copy link
Contributor

This PR adds a new hook for Amazon Simple Email Service (SES).


Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg bot added area:docs provider:amazon AWS/Amazon - related issues labels Aug 18, 2020
@ipeluffo ipeluffo mentioned this pull request Aug 18, 2020
@ipeluffo
Copy link
Contributor Author

It seems that CI Build / Backport packages is still failing with this error:

ERROR: There were some import errors

----------------------------------------
Traceback (most recent call last):
  File "/import_all_provider_classes.py", line 61, in import_all_provider_classes
    _module = importlib.import_module(module_name)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.6/site-packages/airflow/providers/amazon/aws/hooks/ses.py", line 24, in <module>
    from airflow.utils.email import build_mime_message
ImportError: cannot import name 'build_mime_message'

----------------------------------------

I'm not sure what I'm missing here 🤔

@mik-laj
Copy link
Member

mik-laj commented Aug 19, 2020

I'll take a look at it.

@mik-laj
Copy link
Member

mik-laj commented Aug 19, 2020

Okay. I already know what happened. Backport packages are tested with Airflow 1.10.10, so you cannot use Airflow 2.0 function in backport packages unless you also provide an alternative for Airflow 1.10. You can do this by vendoring this method/module to your package. You can do automatically using bowler when creating the package;
Here's some code that does a similar transform for another module.
https://github.com/apache/airflow/blob/master/backport_packages/refactor_backport_packages.py#L641-L649

@mik-laj
Copy link
Member

mik-laj commented Aug 19, 2020

I push a patch on your branch We will check if CI will be happy.

@ipeluffo
Copy link
Contributor Author

CI looks good now, thanks for the patch @mik-laj

@mik-laj
Copy link
Member

mik-laj commented Aug 20, 2020

@feluelle Can you look at it?

@feluelle
Copy link
Member

LGTM, I am merging it.

@feluelle feluelle merged commit 27d08b7 into apache:master Aug 21, 2020
@ipeluffo ipeluffo deleted the ses-hook branch August 29, 2020 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants