Skip to content

python: accept free-form custom extension vendors - #172

Merged
khush-bhatia merged 1 commit into
apache:mainfrom
onkardahale:python-custom-extension-vendors
Jul 14, 2026
Merged

python: accept free-form custom extension vendors#172
khush-bhatia merged 1 commit into
apache:mainfrom
onkardahale:python-custom-extension-vendors

Conversation

@onkardahale

@onkardahale onkardahale commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Custom extension vendor names are free-form strings in the current spec and JSON schema, but the Python package still types OSICustomExtension.vendor_name as the OSIVendor enum. A document that is valid against osi-schema.json, e.g. a custom extension with vendor_name: ACME, is rejected by the Python model.

#91 relaxed vendor_name to a free-form string in the spec and schema but did not update the Python package, so the package is now stricter than the spec it implements.

Change vendor_name to str. OSIVendor stays as well-known constants, and since it is a str enum, comparisons like vendor_name == "DBT" still work. Also fix the converter guide, which still tells contributors to add new vendors to a core enum.

Does not touch root dialects/vendors (#148 covers that). Verified locally that the old model rejects vendor_name: ACME and the new one accepts and round-trips it.

@khush-bhatia

Copy link
Copy Markdown
Contributor

@onkardahale Because of the rename, there are some merge conflicts, could you please resolve that.

Custom extension vendor names are free-form strings in the current OSI specification and JSON schema. The Python model still typed OSICustomExtension.vendor_name as OSIVendor, which rejects schema-valid documents using a vendor name outside the built-in well-known list.

Change vendor_name to str so the Python package accepts any spec-valid custom extension vendor name. Keep OSIVendor available as well-known constants for existing callers.

Update the converter guide to stop telling contributors to add new vendors to a core enum.

Signed-off-by: Onkar Dahale <dahaleonkar@gmail.com>
@onkardahale
onkardahale force-pushed the python-custom-extension-vendors branch from 4b86b11 to 77553b3 Compare July 14, 2026 01:01
@onkardahale

Copy link
Copy Markdown
Contributor Author

@khush-bhatia Fixed it. Merge looks clean now

@jbonofre
jbonofre self-requested a review July 14, 2026 18:40
@khush-bhatia
khush-bhatia merged commit a3da844 into apache:main Jul 14, 2026
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.

2 participants