Just to let you know, that I solved the problem and it had nothing to do 
with the _pb2.py files.
Sorry for the "false alarm". Thanks!

Nelson Meyer schrieb am Dienstag, 25. Oktober 2022 um 12:22:42 UTC+2:

> Hi everyone,
> I hope, this is the right place to ask this question. If not feel free to 
> refer me elsewhere.
>
> *Some installation details:*
> - I have installed the python protobuf according to this guide:
> https://github.com/protocolbuffers/protobuf/tree/main/python 
> - I have put the binary from protoc-21.8-osx-universal_binary.zip 
> <https://github.com/protocolbuffers/protobuf/releases/download/v21.8/protoc-21.8-osx-universal_binary.zip>
>  
> in /usr/local/bin and this path is at first place in the PATH variable
> - the tests ran fine (Output: Ran 911 tests in 25.761s, OK (skipped=9))
>
>
> *Problem:*
> The generated _pb2.py file does not seem to be complete.
> *It contains:*
>
> _sym_db = _symbol_database.Default()
>
> DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19
> jfinder_duplicate.proto\x12\tjfinder\"\xef\x06\n\rduplicate_ads
> \x12\x10\n\x03\x63id\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x12\n\x05\x62
> q_id\x18\x14 \x01(\x05H\x01\x88\x01\x01\x12\x16\n\tj_title\x18\x02 \x01(\t
> H\x02\x88\x01\x01 ...................................x06proto3')
>
> _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
> _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 
> 'jfinder_duplicate_pb2', globals())
> if _descriptor._USE_C_DESCRIPTORS == False:
>
> DESCRIPTOR._options = None
> _DUPLICATE_ADS._serialized_start=41
> _DUPLICATE_ADS._serialized_end=920
> _J_HASHES._serialized_start=922
> _J_HASHES._serialized_end=1022
>
> *What seems to be missing:*
> _DUPLICATE_ADS = .... and _JOB_HASHES =.......
> duplicate_ads = _reflection.GeneratedProtocolMessageType( .......
> j_hashes = _reflection.GeneratedProtocolMessageType(.....
>
> Consequence: Bigquery upload fails.
>
> From what I know, the protoc files and _pb2.py generation using this 
> installation <http://google.github.io/proto-lens/installing-protoc.html> 
> have worked before, but I had to try a new installation due to the error:
> TypeError: Descriptors cannot not be created directly. If this call came 
> from a _pb2.py file, your generated code is out of date and must be 
> regenerated with protoc >= 3.19.0.
>
> Do you have any suggestion on how I can solve this problem?
> Many thanks in advance!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/eee40fd9-8335-4031-a74c-deee83af23ean%40googlegroups.com.

Reply via email to