Stefan Adelbert04/04/2022, 1:06 AM
I'm using a factory to create the op in question, which looks something like this,
Conflicting definitions found in repository with name '_login'. Op/Graph/Solid definition names must be unique within a repository. OpDefinition is defined in job 'abc' and in job 'xyz'.
I use the op in a graph like this,
def login(username, password): @dagster.op def _login(): do_the_login(username, password) return _login
And then that graph gets used in multiple jobs. I could add a unique ID to the name of the op, but that feels like an anti-pattern.
@dagster.graph def g(): login("abc", "xyz")()
claire04/04/2022, 5:10 PM
op currently has many duplicate definitions, which Dagster doesn't allow in order to distinguish between ops that are invoked in many places within a repository.
Stefan Adelbert04/04/2022, 10:38 PM
that get duplicated by passing an identifier (the job name) into the op factory so that the op's name includes the job it belongs to. I'm OK with this solution for now, although I can see a situation where I might have
name clashes in the future. It's my plan to build libraries of reusable ops and it's quite possible that two ops in different libraries could be called
If two of those ops are being used in the same job, prefixing them with the job name would be insufficient to distinguish between them. You could perhaps argue that
is a bad name for an op.
claire04/04/2022, 10:51 PM