great-expectations / great_expectations

Always know what to expect from your data.
https://docs.greatexpectations.io/
Apache License 2.0
9.88k stars 1.53k forks source link

Cannot send Email via EmailAction, when (internal) Email server does not need authentication #9379

Closed MarcelBeining closed 1 month ago

MarcelBeining commented 8 months ago

Describe the bug One is not able to send an Email via an internal server that does not require authentication (see below).

I would be willing do create a PR to fix this, if it is fine, that GX supports sending such emails.

To Reproduce I am using the EmailAction class to send a summary validation result to an email address

from great_expectations.checkpoint import EmailAction
action = EmailAction(
            data_context=None,
            renderer={
                "module_name": "great_expectations.render.renderer.email_renderer",
                "class_name": "EmailRenderer",
            },
            smtp_address=smtp_address,
            smtp_port=smtp_port,
            sender_login=sender_login,
            sender_password=sender_password,
            receiver_emails=",".join(recipients),
            sender_alias=sender_alias,
            use_ssl=security_protocol.lower() == "ssl",
            use_tls=security_protocol.lower() == "tls",
            notify_on=self._notify_on,
            notify_with=None,
        )

When I try to run the action via action.run(...) I get

┌───────────────────── Traceback (most recent call last) ─────────────────────┐ │ C:\XXXXX\scratches\scra │ │ tch_5.py:19 in │ │ │ │ 16 │ "recipients": ["XXXXX"] │ │ 17 } │ │ 18 │ │ > 19 notifier = EmailNotifier(**email_notifier) │ │ 20 │ │ 21 summary_validation_result = ExpectationSuiteValidationResult( │ │ 22 │ success=True, │ │ │ │ XXXXX\venv\lib\site-packages\kedro_expectat │ │ ions\notification.py:85 in init │ │ │ │ 82 │ │ │ notify_on=notify_on, │ │ 83 │ │ │ subject=subject, │ │ 84 │ │ ) │ │ > 85 │ │ self._action = EmailAction( │ │ 86 │ │ │ data_context=None, │ │ 87 │ │ │ renderer={ │ │ 88 │ │ │ │ "module_name": "great_expectations.render.renderer.em │ │ │ │ XXXXXXX\venv\lib\site-packages\great_expectat │ │ ions\checkpoint\actions.py:760 in init │ │ │ │ 757 │ │ self.use_ssl = use_ssl │ │ 758 │ │ assert smtp_address, "No SMTP server address found in action │ │ 759 │ │ assert smtp_port, "No SMTP server port found in action confi │ │ > 760 │ │ assert sender_login, "No login found for sending the email i │ │ 761 │ │ assert ( │ │ 762 │ │ │ sender_password │ │ 763 │ │ ), "No password found for sending the email in action config │ └─────────────────────────────────────────────────────────────────────────────┘ AssertionError: No login found for sending the email in action config.

However I must not provide a login as the server does not require one (it is an internal server and only allow specific recipients). When I provide None or empty strings as login and password, it won't work, as the great expectation utils methos send_email always tries to perform a login with the provided login/password, which will fail.

Expected behavior Should be able to send an email to an internal email server that does not require authentication, by not defining sender_login and sender_password (or define it as None).

Environment (please complete the following information):

Additional context Add any other context about the problem here.

MarcelBeining commented 5 months ago

Nearly 3 months passed, and the accepted PR is still not part of the release! What's going on?

MarcelBeining commented 4 months ago

@TrangPham You were assigned for the PR, do you have any update when this already merged PR is finally going into release?

MarcelBeining commented 3 months ago

@TrangPham @anthonyburdi What's going on here? 5 months passed, still accepted PR #9388 not part of any release! Very disappointed

molliemarie commented 1 month ago

Hello @MarcelBeining. With the launch of Great Expectations Core (GX 1.0), we are closing old issues posted regarding previous versions. Moving forward, we will focus our resources on supporting and improving GX Core (version 1.0 and beyond). If you find that an issue you previously reported still exists in GX Core, we encourage you to resubmit it against the new version. With more resources dedicated to community support, we aim to tackle new issues swiftly. For specific details on what is GX-supported vs community-supported, you can reference our integration and support policy.

To get started on your transition to GX Core, check out the GX Core quickstart (click “Full example code” tab to see a code example).

You can also join our upcoming community meeting on August 28th at 9am PT (noon ET / 4pm UTC) for a comprehensive rundown of everything GX Core, plus Q&A as time permits. Go to https://greatexpectations.io/meetup and click “follow calendar” to follow the GX community calendar.

Thank you for being part of the GX community and thank you for submitting this issue. We're excited about this new chapter and look forward to your feedback on GX Core. 🤗