https://flyte.org logo
#ask-the-community
Title
# ask-the-community
r

Ryuu

10/31/2023, 11:16 AM
I want to centralize all self definded Datatype based on python object only by using @dataclass_json @dataclass or . That mean all datatype I will push in 1 folder such as datatype_flyte. Then the workflow which want to use any datatype in folder datatype_flyte will import its. but when do that, the job registration the workflow which import the external module in localhost such as datatype_flyte cannot be understood. How to deal with this problem.
s

Samhita Alla

11/01/2023, 5:14 AM
Sorry, haven't understood your problem. Is it possible for you share the code and explain what you're trying to do?
r

Ryuu

11/01/2023, 5:19 AM
Here, I want to defind all mydata struct like this in 1 folder flyte_dataclass, and i want to import it to the workflow which need to use that datastruct. The datastruct which base on typing or dataclass are not needed to resigeter in Flyte native type engine. @Samhita Alla
s

Samhita Alla

11/01/2023, 5:26 AM
So you want to import dataclass defined in a different file into the file that has your workflow?
r

Ryuu

11/01/2023, 5:32 AM
@Samhita Alla yes
s

Samhita Alla

11/01/2023, 5:54 AM
You just can say:
from .base_hyperparams import BaseHyperparams
r

Ryuu

11/01/2023, 7:02 AM
thanks, my syntax is not have the dot and i cant run it. thank you @Samhita Alla