Conflicting Definitions when using Op factory I'm...
# ask-community
Conflicting Definitions when using Op factory I'm upgrading from 0.13.16 to 0.14.7 and I'm getting an error for code that was working,
Copy code
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'm using a factory to create the op in question, which looks something like this,
Copy code
def login(username, password):
    def _login():
        do_the_login(username, password)
    return _login
I use the op in a graph like this,
Copy code
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.
Hi Stefan, the easiest solution is to pass a unique name to every definition of the
op. The
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.
@claire This is exactly what I'm doing. I started with postfixing each op name that was being duplicated with a UID, but that was not a nice solution because the job names don't read well. I then moved to "namespacing" the
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.
Yeah, another option would be to prefix the ops with the name of the library they belong in