Stefan Adelbert
04/04/2022, 1:06 AMConflicting 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'm using a factory to create the op in question, which looks something like this,
def login(username, password):
@dagster.op
def _login():
do_the_login(username, password)
return _login
I use the op in a graph like this,
@dagster.graph
def g():
login("abc", "xyz")()
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.claire
04/04/2022, 5:10 PM_login
op. The _login
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 Adelbert
04/04/2022, 10:38 PMops
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 op
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 login.
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 login
is a bad name for an op.claire
04/04/2022, 10:51 PM