nutritious-telephone-58961
10/18/2024, 6:37 AMdamp-lion-88352
10/18/2024, 6:52 AMdamp-lion-88352
10/18/2024, 6:52 AMdamp-lion-88352
10/18/2024, 6:52 AMdamp-lion-88352
10/18/2024, 7:22 AMnutritious-telephone-58961
10/18/2024, 8:06 AMfrom dataclasses import dataclass
from typing import Optional, Union
from flytekit import task, workflow
@dataclass
class A:
i: int
@dataclass
class B:
nested_class: A
@dataclass
class C:
i: int
j: Optional[int]
k: int = 5
@task
def my_task() -> A:
return A(i=1)
@task
def foo(input: Union[B, C]):
print(input)
@workflow
def my_wf():
a = my_task()
foo(input=a)
cool-lifeguard-49380
10/18/2024, 12:43 PMclass B(A)
.cool-lifeguard-49380
10/18/2024, 12:43 PMcool-lifeguard-49380
10/18/2024, 12:45 PM@task(b: B)
and the question is whether an a
is a match.cool-lifeguard-49380
10/18/2024, 12:46 PMfreezing-airport-6809
high-accountant-32689
10/21/2024, 3:33 PMdamp-lion-88352
10/21/2024, 4:25 PMthankful-minister-83577
thankful-minister-83577
We avoid GPLv3 software because merely linking to it is considered by the GPLv3 authors to create a derivative work.But the L in GPL supposedly allows it
The main difference between the GPL and the LGPL is that the latter allows the work to be linked with (in the case of a library, “used by”) a non-(L)GPLed program.is the lgpl one much better?
damp-lion-88352
10/24/2024, 4:30 AMnutritious-telephone-58961
10/24/2024, 5:41 AMthe specific case you’re referring to should not work right? B is not a subclass of A, it just contains an A. i think just a schema check is the most appropriate and is completely sufficient. what are the two libraries you’re looking at?So will class C match with an input of class A? Something like the example below:
@dataclass
class C(A):
j: Optional[int]
k: int = 5
The main problem is that if we plan to support comparing jsonschemas generated from marshmallow
and mashumaro
, they have huge differences in their structure.
To compare them, we need additional processes. The two libraries I originally used are json_schema_compare and jsonschema, but actually they can not handle all the differences, which means we still need to do some processing before or after by ourselves. We are still finding other useful packages as well.
Btw thanks for the clarification of LGPL license!