Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINTENANCE] Provide better error messaging if batch_request is not supplied to DataAssistant.run() #5473

Conversation

alexsherstinsky
Copy link
Contributor

@alexsherstinsky alexsherstinsky commented Jul 8, 2022

Scope

Previously, missing batch_request would cause DataAssistant.run() to simply fail with an AttributeError. Now, a formal error message is provided.

Please annotate your PR title to describe what the PR does, then give a brief bulleted description of your PR below. PR titles should begin with [BUGFIX], [FEATURE], [DOCS], or [MAINTENANCE]. If a new feature introduces breaking changes for the Great Expectations API or configuration files, please also add [BREAKING]. You can read about the tags in our contributor checklist.

Changes proposed in this pull request:

  • JIRA: GREAT-761/GREAT-1038

After submitting your PR, CI checks will run and @cla-bot will check for your CLA signature.

For a PR with nontrivial changes, we review with both design-centric and code-centric lenses.

In a design review, we aim to ensure that the PR is consistent with our relationship to the open source community, with our software architecture and abstractions, and with our users' needs and expectations. That review often starts well before a PR, for example in github issues or slack, so please link to relevant conversations in notes below to help reviewers understand and approve your PR more quickly (e.g. closes #123).

Previous Design Review notes:

Definition of Done

Please delete options that are not relevant.

  • My code follows the Great Expectations style guide
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added unit tests where applicable and made sure that new and existing tests are passing.
  • I have run any local integration tests and made sure that nothing is broken.

Thank you for submitting!

@ghost
Copy link

ghost commented Jul 8, 2022

👇 Click on the image for a new way to code review
  • Make big changes easier — review code in small groups of related files

  • Know where to start — see the whole change at a glance

  • Take a code tour — explore the change with an interactive tour

  • Make comments and review — all fully sync’ed with github

    Try it now!

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

@netlify
Copy link

netlify bot commented Jul 8, 2022

Deploy Preview for niobium-lead-7998 ready!

Name Link
🔨 Latest commit 764aa46
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/62c8b69c4499690008029f5d
😎 Deploy Preview https://deploy-preview-5473--niobium-lead-7998.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.


pass


class ProfilerExecutionError(ProfilerError):
"""A runtime error for a profiler."""
"""A runtime error for a "RuleBasedProfiler" class."""
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Comment on lines +454 to +457
if self._data_context is None:
usage_statistics_handler = None
else:
usage_statistics_handler = self._data_context._usage_statistics_handler
Copy link
Contributor

Choose a reason for hiding this comment

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

Making sure this variable always exists

Comment on lines +197 to +200
raise ge_exceptions.DataAssistantExecutionError(
message=f"""Utilizing "{data_assistant_name}.run()" requires valid "batch_request" to be \
specified (empty or missing "batch_request" detected)."""
)
Copy link
Contributor

Choose a reason for hiding this comment

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

:)

Copy link
Contributor

Choose a reason for hiding this comment

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

love it

Copy link
Contributor

@Shinnnyshinshin Shinnnyshinshin left a comment

Choose a reason for hiding this comment

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

Love it

@alexsherstinsky alexsherstinsky enabled auto-merge (squash) July 8, 2022 23:29
@alexsherstinsky alexsherstinsky merged commit cd82192 into develop Jul 9, 2022
@alexsherstinsky alexsherstinsky deleted the feature/GREAT-761/GREAT-1038/alexsherstinsky/rule_based_profiler/data_assistant/improve_error_message_when_batch_request_not_specified_for_run_method-2022_07_08-183 branch July 9, 2022 00:12
Shinnnyshinshin pushed a commit that referenced this pull request Jul 9, 2022
…gration-and-validators

* develop:
  Update snapshots (#5474)
  better error messaging if batch_request is not supplied to DataAssistant.run() method (#5473)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants