Skip to content

Conversation

@haizhou-zhao
Copy link
Contributor

Details described on #9837

@dramaticlly
Copy link
Contributor

Can you do make generate to have python code update as well? Otherwise LGTM

@haizhou-zhao
Copy link
Contributor Author

Can you do make generate to have python code update as well? Otherwise LGTM

@dramaticlly Tested with OpenAPI's python generator (if that's what you mean), details also in the issue #9837. Though you'll need to scroll a bit down to see that.

@dramaticlly
Copy link
Contributor

Can you do make generate to have python code update as well? Otherwise LGTM

@dramaticlly Tested with OpenAPI's python generator (if that's what you mean), details also in the issue #9837. Though you'll need to scroll a bit down to see that.

Can you check if your workspace is empty after generate? I think it will update the python file and you need that as part of your commit. You can see pull request build also failed for the same reason

@dramaticlly dramaticlly force-pushed the spec-snapshot-summary branch from edb67af to f4804aa Compare March 13, 2024 17:56
@dramaticlly
Copy link
Contributor

@nastra @Fokko can you help review the change?


class Summary(BaseModel):
operation: Literal['append', 'replace', 'overwrite', 'delete']
additionalProperties: Optional[str] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have expected the summary to also have Optional[Dict[str, str]] = None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I used the plain OpenAPI generator (tested on 6.6.0 & 7.0.0) to generate python code, this is what I got

...
class SnapshotSummary(BaseModel):
    """
    SnapshotSummary
    """
    operation: StrictStr = Field(...)
    additional_properties: Dict[str, Any] = {}
    __properties = ["operation"]
...

Which is closer to what you suggested above. I guess the code generation process here might leverage some different library.

Copy link
Contributor

Choose a reason for hiding this comment

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

So every generator is different. I don't think this is supported by the one we use right now. But I think the change in the yaml is correct 👍

enum: ["append", "replace", "overwrite", "delete"]
additionalProperties:
type: string
additionalProperties:
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

@nastra nastra left a comment

Choose a reason for hiding this comment

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

LGTM, @Fokko could you please take a look at the generated python code?

@nastra nastra changed the title [ISSUE-9837] Correct additionalProperties for SnapshotSummary Model OpenAPI: Fix additionalProperties for SnapshotSummary Mar 14, 2024
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks @haizhou-zhao for working on this, and @nastra for the review 👍


class Summary(BaseModel):
operation: Literal['append', 'replace', 'overwrite', 'delete']
additionalProperties: Optional[str] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

So every generator is different. I don't think this is supported by the one we use right now. But I think the change in the yaml is correct 👍

@Fokko Fokko merged commit ba1cd36 into apache:main Apr 4, 2024
@dramaticlly dramaticlly deleted the spec-snapshot-summary branch April 4, 2024 21:34
sasankpagolu pushed a commit to sasankpagolu/iceberg that referenced this pull request Oct 27, 2024
* [ISSUE-9837] Correct additionalProperties for SnapshotSummary Model

* Include minimal change to generated python files

---------

Co-authored-by: Haizhou Zhao <haizhou_zhao@apple.com>
Co-authored-by: Steve Zhang <hongyue_zhang@apple.com>
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
* [ISSUE-9837] Correct additionalProperties for SnapshotSummary Model

* Include minimal change to generated python files

---------

Co-authored-by: Haizhou Zhao <haizhou_zhao@apple.com>
Co-authored-by: Steve Zhang <hongyue_zhang@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants