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

[Bug]: Error with subclassing behavior in pw.Schema #9

Open
berkecanrizai opened this issue Mar 14, 2024 · 0 comments
Open

[Bug]: Error with subclassing behavior in pw.Schema #9

berkecanrizai opened this issue Mar 14, 2024 · 0 comments
Assignees
Labels
bug Something isn't working confirmed Problem or bug confirmed priority:low Triaged: low priority issue

Comments

@berkecanrizai
Copy link
Contributor

Steps to reproduce

If you have a schema that has an optional parameter, and you create a subclass of that schema, the optional parameter becomes non-optional.

Example:

class SummarizeQuerySchema(pw.Schema):
    text_list: list[str]
    model: str | None = pw.column_definition(default_value="gpt-3.5-turbo")
class SummarizeQuerySchemaAPI(SummarizeQuerySchema):
    openai_api_key: str

In this case, model that was optional becomes non-optional in the second schema.

Relevant log output

I get an error message stating `model` is needed during runtime.

What did you expect to happen?

It should keep the initial behavior after inheriting.

Version

0.8.2

Docker Versions (if used)

No response

OS

Linux

On which CPU architecture did you run Pathway?

x86-64

@berkecanrizai berkecanrizai added the bug Something isn't working label Mar 14, 2024
@dxtrous dxtrous added priority:low Triaged: low priority issue confirmed Problem or bug confirmed labels Mar 15, 2024
@izulin izulin assigned voodoo11 and unassigned izulin Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed Problem or bug confirmed priority:low Triaged: low priority issue
Projects
None yet
Development

No branches or pull requests

4 participants