Explore adding a union type
See original GitHub issueI think this could leverage a lot of the same stuff the other wrapper types like List
and Optional
do.
Example from user:
from type import Union
### The reason why I'd like to have something like this is that I want to acts a combiner function that accepts both types of
### values. I don't want to have to attach config parameters to descriminate the input and output type but it may the direction that I would need to go?
@solid(
input_defs=[InputDefinition('provider_partials', List[Union[ProviderDataFrame, ProviderSeries]])],
output_defs=[OutputDefinition(ProviderPartialDataFrame)],
)
def merge_provider_partials(context, provider_partials):
context.log.info('Merging provider partials to providers')
partial = pd.concat(provider_partials, axis=1)
return partial
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Handbook - Unions and Intersection Types
How to use unions and intersection types in TypeScript. ... If 'padding' is a number, then that number of spaces is added to...
Read more >Learn TypeScript: Union Types Cheatsheet
You can declare a union type consisting of literal types, such as string literals, number literals or boolean literals. These will create union...
Read more >typescript - combine union type object building
Issue here is that based on type I'll add to "type" I can't figure how to select correct payload type (and return type)....
Read more >Union Types in TypeScript - YouTube
A union type in TypeScript allows you to declare a value that can have different types.Timeline:00:08 - What is a union type ?00:51...
Read more >Union Types in Flow & Reason - Jake Zimmerman
In this post, we're going to explore why that's the case. We'll start with a problem which union types can solve, flesh out...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@schrockn Where can I learn about ScalarUnion? I can’t find anything about it on the docs site.
For runtime types, we now have unions via PythonObjectDagsterType. Also looks like ScalarUnion is documented now, but @kinghuang please let us know if you need more info there