dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
11.98k stars 1.5k forks source link

Conflicting names of proto files #22395

Open michael-l-a opened 5 months ago

michael-l-a commented 5 months ago

Dagster version

dagster, version 1.5.9

What's the issue?

I have a simplified project where Dagster just imports Dgraph (both libraries use file api.proto in the same directory)

Command: dagster dev Output (Cmd+F TypeError: Couldn't build proto file into descriptor pool: duplicate file name api.proto):

2024-06-09 16:31:01 +0200 - dagster - INFO - Using temporary directory /Users/michael/code/my-dagster-project/tmpr2xlowdc for storage. This will be removed when dagster dev exits. 2024-06-09 16:31:01 +0200 - dagster - INFO - To persist information across sessions, set the environment variable DAGSTER_HOME to a directory to use. 2024-06-09 16:31:02 +0200 - dagster - INFO - Launching Dagster services... 2024-06-09 16:31:05 +0200 - dagster.code_server - ERROR - Error while importing code Traceback (most recent call last): File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/dagster/_core/errors.py", line 287, in user_code_error_boundary yield File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/dagster/_grpc/server.py", line 245, in init loadable_targets = get_loadable_targets( ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/dagster/_grpc/utils.py", line 50, in get_loadable_targets else loadable_targets_from_python_module(module_name, working_directory) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/dagster/_core/workspace/autodiscovery.py", line 31, in loadable_targets_from_python_module module = load_python_module( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/dagster/_core/code_pointer.py", line 134, in load_python_module return importlib.import_module(module_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/Users/michael/code/my-dagster-project/src/init.py", line 1, in from pydgraph import DgraphClient File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/pydgraph/init.py", line 15, in from pydgraph.proto.api_pb2 import Operation, Payload, Request, Response, Mutation, TxnContext,\ File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/pydgraph/proto/api_pb2.py", line 16, in DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\tapi.proto\x12\x03\x61pi\"\xb8\x02\n\x07Request\x12\x10\n\x08start_ts\x18\x01 \x01(\x04\x12\r\n\x05query\x18\x04 \x01(\t\x12$\n\x04vars\x18\x05 \x03(\x0b\x32\x16.api.Request.VarsEntry\x12\x11\n\tread_only\x18\x06 \x01(\x08\x12\x13\n\x0b\x62\x65st_effort\x18\x07 \x01(\x08\x12 \n\tmutations\x18\x0c \x03(\x0b\x32\r.api.Mutation\x12\x12\n\ncommit_now\x18\r \x01(\x08\x12,\n\x0bresp_format\x18\x0e \x01(\x0e\x32\x17.api.Request.RespFormat\x12\x0c\n\x04hash\x18\x0f \x01(\t\x1a+\n\tVarsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x1f\n\nRespFormat\x12\x08\n\x04JSON\x10\x00\x12\x07\n\x03RDF\x10\x01\"\x14\n\x04Uids\x12\x0c\n\x04uids\x18\x01 \x03(\t\"\x1d\n\x0cListOfString\x12\r\n\x05value\x18\x01 \x03(\t\"\xbc\x02\n\x08Response\x12\x0c\n\x04json\x18\x01 \x01(\x0c\x12\x1c\n\x03txn\x18\x02 \x01(\x0b\x32\x0f.api.TxnContext\x12\x1d\n\x07latency\x18\x03 \x01(\x0b\x32\x0c.api.Latency\x12\x1d\n\x07metrics\x18\x04 \x01(\x0b\x32\x0c.api.Metrics\x12%\n\x04uids\x18\x0c \x03(\x0b\x32\x17.api.Response.UidsEntry\x12\x0b\n\x03rdf\x18\r \x01(\x0c\x12%\n\x04hdrs\x18\x0e \x03(\x0b\x32\x17.api.Response.HdrsEntry\x1a+\n\tUidsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a>\n\tHdrsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.api.ListOfString:\x02\x38\x01\"\xad\x01\n\x08Mutation\x12\x10\n\x08set_json\x18\x01 \x01(\x0c\x12\x13\n\x0b\x64\x65lete_json\x18\x02 \x01(\x0c\x12\x12\n\nset_nquads\x18\x03 \x01(\x0c\x12\x12\n\ndel_nquads\x18\x04 \x01(\x0c\x12\x17\n\x03set\x18\x05 \x03(\x0b\x32\n.api.NQuad\x12\x17\n\x03\x64\x65l\x18\x06 \x03(\x0b\x32\n.api.NQuad\x12\x0c\n\x04\x63ond\x18\t \x01(\t\x12\x12\n\ncommit_now\x18\x0e \x01(\x08\"\xd2\x01\n\tOperation\x12\x0e\n\x06schema\x18\x01 \x01(\t\x12\x11\n\tdrop_attr\x18\x02 \x01(\t\x12\x10\n\x08\x64rop_all\x18\x03 \x01(\x08\x12&\n\x07\x64rop_op\x18\x04 \x01(\x0e\x32\x15.api.Operation.DropOp\x12\x12\n\ndrop_value\x18\x05 \x01(\t\x12\x19\n\x11run_in_background\x18\x06 \x01(\x08\"9\n\x06\x44ropOp\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03\x41LL\x10\x01\x12\x08\n\x04\x44\x41TA\x10\x02\x12\x08\n\x04\x41TTR\x10\x03\x12\x08\n\x04TYPE\x10\x04\"\x17\n\x07Payload\x12\x0c\n\x04\x44\x61ta\x18\x01 \x01(\x0c\"m\n\nTxnContext\x12\x10\n\x08start_ts\x18\x01 \x01(\x04\x12\x11\n\tcommit_ts\x18\x02 \x01(\x04\x12\x0f\n\x07\x61\x62orted\x18\x03 \x01(\x08\x12\x0c\n\x04keys\x18\x04 \x03(\t\x12\r\n\x05preds\x18\x05 \x03(\t\x12\x0c\n\x04hash\x18\x06 \x01(\t\"\x07\n\x05\x43heck\"\x16\n\x07Version\x12\x0b\n\x03tag\x18\x01 \x01(\t\"x\n\x07Latency\x12\x12\n\nparsing_ns\x18\x01 \x01(\x04\x12\x15\n\rprocessing_ns\x18\x02 \x01(\x04\x12\x13\n\x0b\x65ncoding_ns\x18\x03 \x01(\x04\x12\x1b\n\x13\x61ssign_timestamp_ns\x18\x04 \x01(\x04\x12\x10\n\x08total_ns\x18\x05 \x01(\x04\"f\n\x07Metrics\x12+\n\x08num_uids\x18\x01 \x03(\x0b\x32\x19.api.Metrics.NumUidsEntry\x1a.\n\x0cNumUidsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x04:\x02\x38\x01\"\xa3\x01\n\x05NQuad\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\x11\n\tpredicate\x18\x02 \x01(\t\x12\x11\n\tobject_id\x18\x03 \x01(\t\x12 \n\x0cobject_value\x18\x04 \x01(\x0b\x32\n.api.Value\x12\x0c\n\x04lang\x18\x06 \x01(\t\x12\x1a\n\x06\x66\x61\x63\x65ts\x18\x07 \x03(\x0b\x32\n.api.Facet\x12\x11\n\tnamespace\x18\x08 \x01(\x04J\x04\x08\x05\x10\x06\"\xf4\x01\n\x05Value\x12\x15\n\x0b\x64\x65\x66\x61ult_val\x18\x01 \x01(\tH\x00\x12\x13\n\tbytes_val\x18\x02 \x01(\x0cH\x00\x12\x11\n\x07int_val\x18\x03 \x01(\x03H\x00\x12\x12\n\x08\x62ool_val\x18\x04 \x01(\x08H\x00\x12\x11\n\x07str_val\x18\x05 \x01(\tH\x00\x12\x14\n\ndouble_val\x18\x06 \x01(\x01H\x00\x12\x11\n\x07geo_val\x18\x07 \x01(\x0cH\x00\x12\x12\n\x08\x64\x61te_val\x18\x08 \x01(\x0cH\x00\x12\x16\n\x0c\x64\x61tetime_val\x18\t \x01(\x0cH\x00\x12\x16\n\x0cpassword_val\x18\n \x01(\tH\x00\x12\x11\n\x07uid_val\x18\x0b \x01(\x04H\x00\x42\x05\n\x03val\"\xab\x01\n\x05\x46\x61\x63\x65t\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c\x12$\n\x08val_type\x18\x03 \x01(\x0e\x32\x12.api.Facet.ValType\x12\x0e\n\x06tokens\x18\x04 \x03(\t\x12\r\n\x05\x61lias\x18\x05 \x01(\t\"A\n\x07ValType\x12\n\n\x06STRING\x10\x00\x12\x07\n\x03INT\x10\x01\x12\t\n\x05\x46LOAT\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\x0c\n\x08\x44\x41TETIME\x10\x04\"Z\n\x0cLoginRequest\x12\x0e\n\x06userid\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\x12\x15\n\rrefresh_token\x18\x03 \x01(\t\x12\x11\n\tnamespace\x18\x04 \x01(\x04\".\n\x03Jwt\x12\x12\n\naccess_jwt\x18\x01 \x01(\t\x12\x13\n\x0brefresh_jwt\x18\x02 \x01(\t2\xe7\x01\n\x06\x44graph\x12+\n\x05Login\x12\x11.api.LoginRequest\x1a\r.api.Response\"\x00\x12&\n\x05Query\x12\x0c.api.Request\x1a\r.api.Response\"\x00\x12\'\n\x05\x41lter\x12\x0e.api.Operation\x1a\x0c.api.Payload\"\x00\x12\x33\n\rCommitOrAbort\x12\x0f.api.TxnContext\x1a\x0f.api.TxnContext\"\x00\x12*\n\x0c\x43heckVersion\x12\n.api.Check\x1a\x0c.api.Version\"\x00\x42\x18\n\tio.dgraphB\x0b\x44graphProtob\x06proto3') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Couldn't build proto file into descriptor pool: duplicate file name api.proto

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/dagster/_grpc/server.py", line 411, in init self._loaded_repositories: Optional[LoadedRepositories] = LoadedRepositories( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/dagster/_grpc/server.py", line 234, in init with user_code_error_boundary( File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/contextlib.py", line 158, in exit self.gen.throw(typ, value, traceback) File "/usr/local/anaconda3/envs/dgraph/lib/python3.11/site-packages/dagster/_core/errors.py", line 297, in user_code_error_boundary raise new_error from e dagster._core.errors.DagsterUserCodeLoadError: Error occurred during the loading of Dagster definitions in executable_path=/usr/local/anaconda3/envs/dgraph/bin/python, module_name=src, working_directory=/Users/michael/Dropbox/Projects/NSQ/ProductLevel/Operance/product/codebase/my-dagster-project

What did you expect to happen?

nothing, silent import

How to reproduce?

Create files:

pyproject.toml:

[tool.poetry]
name = "my_project"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "3.11.9"
dagster = "^1.7.9"
dagster-webserver = "^1.7.9"
pydgraph = "^23.0.2"

[tool.dagster]
module_name = "src"

src/__init__.py:

from pydgraph import DgraphClient

Run poetry install

Run dagster dev

Deployment type

None

Deployment details

No response

Additional information

Both dagster and dgraph have the same issue: creating an api.proto file in the root directory. And, thus, conflicting.

In protobuf issues tracker I have found that it is advices to use unique path for proto file.

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.

PabloCastellano commented 4 months ago

@michael-l-a I made a fix in pydgraph in case you want to try it: https://github.com/PabloCastellano/pydgraph/tree/fix-protobuf

poetry add git+https://github.com/PabloCastellano/pydgraph.git#fix-protobuf