Replies: 2 comments 3 replies
|
For (1), I'd love to be able to have a mapping of Python types (e.g. class DataType:
@classmethod
def infer_datatype(cls, datatype_specifier: str | type | DataType):
if isinstance(datatype_specifier, DataType):
return datatype_specifier
else if isinstance(datatype_specifier, str):
return from_sql_string(...)
else:
# custom Python mapping
if datatype_specifier is str:
...Please do make an issue for us here! I'd like for folks in the team to take a look at this. For (2), could you elaborate on this ask? If you provide some examples of an API you'd like here in an issue, I think the team would love to take a look. Perhaps this + the first suggestion could look like: @udf(return_dtype={"foo": str, "bar": int}) # Python dict can be inferred as a struct type Struct[foo: String, bar: Int64]
def myfunc(bboxes, images, labels):
return {
"foo": [...],
"bar": [...],
}Great suggestions, would love to know your thoughts :) |
3 replies
|
Just wanted to add a reference to my comment on the pydantic issue discussion which touches on Structured generation interop, dataype & schema conversion #2774 . |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi!
I think there's two things that could be done to improve the utility of UDF:s in the case of Deep Learning.
I hope we can have a discussion on this!
All reactions