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

Gather and expose errors #453

Merged
merged 5 commits into from
Mar 25, 2025
Merged

Conversation

mamo3gr
Copy link
Contributor

@mamo3gr mamo3gr commented Mar 7, 2025

Motivation

Gokart users catch some errors to deal with them according to the errors' details in their applications. But exceptions of this library exist (and will be created in the future) in each sub-module. Users would need to locate their desired exception and keep it in mind.

Proposal

Errors should be gathered and exposed in gokart.errors module.
Descriptions would be helpful for the users.

Discussion

Moving actual implementations or aliasing

By now, I think it is sufficient to just alias the exceptions (import them from gokart.errors module) because existing exceptions are raised from a single source in many cases, and they are located near the source (raiser).

Location to gather

As an alternative way, exceptions can be located under gokart module. In that case gokart.__init__.py would be a little messy.

@mamo3gr mamo3gr force-pushed the feat/expose-errors branch from 3bba6b0 to 0e31c7c Compare March 7, 2025 22:21
Copy link
Collaborator

@hirosassa hirosassa left a comment

Choose a reason for hiding this comment

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

Looks great 👍👍

@kitagry kitagry requested a review from Copilot March 8, 2025 02:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR gathers and exposes various error classes by centralizing exception definitions and providing descriptive docstrings to aid users in understanding the error context. Key changes include:

  • Introducing the new module gokart/errors/init.py that aliases several error classes.
  • Adding descriptive docstrings to existing exceptions in gokart/pandas_type_config.py, gokart/build.py, and gokart/task.py.
  • Updating gokart/slack/init.py to include new error types along with existing components.

Reviewed Changes

File Description
gokart/errors/init.py Created to re-export error classes from various modules.
gokart/slack/init.py Updated to import and expose new Slack-related error types.
gokart/pandas_type_config.py Added a docstring to the PandasTypeError for clarity.
gokart/build.py Added a docstring for GokartBuildError and HasLockedTaskException; note a potential typo in parameter naming.
gokart/task.py Updated the EmptyDumpError docstring to improve clarity.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

gokart/build.py:44

  • Typo in parameter name 'messsage'. It should be corrected to 'message' to ensure clarity and consistency.
def __init__(self, messsage, raised_exceptions: dict[str, list[Exception]]):

Copy link
Contributor

@mski-iksm mski-iksm left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@mamo3gr
Copy link
Contributor Author

mamo3gr commented Mar 25, 2025

Thank you for reviewers!
All checks have passed and ready to merge. Would you mind merging or can I merge by myself?

@hirosassa hirosassa merged commit 68fa264 into m3dev:master Mar 25, 2025
8 checks passed
@hirosassa
Copy link
Collaborator

@mamo3gr Merged! Thank you for contribution!

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.

4 participants