Re: [protobuf] How to initialize embedded messages in Python?

2023-11-08 Thread 'Nathaniel Manista' via Protocol Buffers
On Wed, Nov 8, 2023 at 7:42 AM Jens Troeger  wrote:

> but what about
>
> foo = Foo(bar=Bar(i=5))
>

This is the preferred form. Please consider adding your  to issue 2782
 about boosting
the clarity of this preference in the documentation.
-N

-- 
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 protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAEOYnAQ6FcsoGFbx%3Dk8yqpqtuLEbEvQOLtnhKYbz_EPgrR9xjQ%40mail.gmail.com.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [protobuf] wrong spelling on Python API reference

2018-12-03 Thread 'Nathaniel Manista' via Protocol Buffers
It looks like that problem has been fixed
<https://github.com/protocolbuffers/protobuf/commit/3886860aa46f6b8b7013f77baf7daeed9b7647c3>,
but the fix just hasn't yet been published. I think issue 4498
<https://github.com/protocolbuffers/protobuf/issues/4498> tracks that the
currently-published documentation is out of date and that documentation
publication is at this time included in the release process.
-Nathaniel

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [protobuf] Is proto3 specification still beta?

2018-04-30 Thread 'Nathaniel Manista' via Protocol Buffers
On Mon, Apr 30, 2018 at 10:57 AM, 'Feng Xiao' via Protocol Buffers <
protobuf@googlegroups.com> wrote:

> On Mon, Apr 30, 2018 at 6:37 AM Gary Pennington <gary...@gmail.com> wrote:
>
>> This is probably a silly question, but:
>>
>> "Is protocol buffers language 3 a finished specification?"
>>
>> At various points on the gRPC pages, e.g.: https://grpc.io/docs/
>> tutorials/basic/java.html, the text specifically mentions that "the
>> proto3 version of the protocol buffers language, which is currently in beta
>> release".
>>
>> I tried trawling around the protocol buffers website and can't find a
>> categorical statement.
>>
>> Can anyone provide clarification?
>>
> Proto3 has been used in production for quite a while. It's in GA status.
> That gPRC page needs some updates.
>

I've filed a work item here
<https://github.com/grpc/grpc.github.io/issues/656>.
-Nathaniel

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME Cryptographic Signature


[protobuf] Re: [grpc-io] Python: proto3 + generated server file names

2017-08-22 Thread 'Nathaniel Manista' via Protocol Buffers
+protobuf@googlegroups.com

On Tue, Aug 22, 2017 at 6:06 AM, Amit Saha <amitsaha...@gmail.com> wrote:

> Hey all,
>
> Consider the sample .proto file:
>
>
> ```
> syntax = "proto3";
>
> // The greeting service definition.
> service Greeter {
>   // Sends a greeting
>   rpc SayHello (HelloRequest) returns (HelloReply) {}
>   // Sends another greeting
>   rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
> }
>
> // The request message containing the user's name.
> message HelloRequest {
>   string name = 1;
> }
>
> // The response message containing the greetings
> message HelloReply {
>   string message = 1;
> }
> ```
>
> When I generate the client and server:
>
> ```
> $ python -m grpc_tools.protoc -I../protos --python_out=.
> --grpc_python_out=. ../protos/service.proto
> ```
>
> The filenames are service_pb2.py   and   service_pb2_grpc.py. Should I not
> be expecting `pb3` in the filenames consider I am declaring the syntax to
> be proto3?
>
> Relevant packages + versions:
>
> ```
> $ pip list
> grpcio (1.4.0)
> grpcio-tools (1.4.0)
> protobuf (3.4.0)
> setuptools (28.8.0)
> ```
>

This is a Protocol Buffers thing much more than it is a gRPC thing, and I
could be wrong about the reason, but my impression is that the "2" in
"_pb2.py" (and thus in "_pb2_grpc.py", because we on the gRPC side just
wanted to match what was being done on the Protocol Buffers side) denotes
the *API version of the generated Python code*, not the .proto syntax
version and also not the Protocol Buffers implementation version.

There may not be much available documentation about API version 1 of the
generated Python code (files ending in "_pb.py") because it was a long time
ago. Also because it may only have ever been Google-internal.
Generated-Python-code API Version 2 is definitely much better.

Protocol Buffers Team, please confirm/correct this account?
-Nathaniel (gRPC Python developer; not authoritatively knowledgable about
Protocol Buffers Python)

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [protobuf] Typo in the doc

2017-02-06 Thread 'Nathaniel Manista' via Protocol Buffers
On Sun, Feb 5, 2017 at 9:39 AM, Louis Cognault <louis.cogna...@gmail.com>
wrote:

> Please, tell me when it's fixed! :)
>

How about now?
-Nathaniel

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [protobuf] Typo in the doc

2017-02-05 Thread 'Nathaniel Manista' via Protocol Buffers
On Sun, Feb 5, 2017 at 9:39 AM, Louis Cognault <louis.cogna...@gmail.com>
wrote:

> I spotted a typo here
> <https://developers.google.com/protocol-buffers/docs/proto3#assigning-tags> in
> the second paragraph, second line where "though" is written in place of "th
> *r*ough" (19000 th*r*ough 1).
>

Thank you for letting us know!

Please, tell me when it's fixed! :)
>

I've started the process; it may be a few days before the change is live.
-Nathaniel

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME Cryptographic Signature


[protobuf] Re: [grpc-io] grpcio examples for python 2.7

2016-09-15 Thread 'Nathaniel Manista' via Protocol Buffers
+protobuf@googlegroups.com once more with feeling

On Thu, Sep 15, 2016 at 8:41 AM, Nathaniel Manista <nathan...@google.com>
wrote:

> +protobuf@googlegroups.com
>
> On Wed, Sep 14, 2016 at 10:10 PM, <muataim...@gmail.com> wrote:
>
>> >>> gRPC Python sounds like a great fit for your use.
>> I think the same.
>>
>> And another small question. A can't find mechanizm in documentation how
>> can i create user-define type. I need something like decimal, but in
>> "Scalar Value Types" i can get only python float type. A search in this
>> group, but can find only this post
>> <https://groups.google.com/forum/#!topic/protobuf/eFDUKVao6CU>. Maybe
>> you have a small manual how can i create special type for my project?
>>
>
> This is more of a "how do I design my Protocol Buffers messages" question
> than a gRPC question; I certainly don't know the answer. Proto party
> people, your thoughts?
>

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


CodedInputStream.readMessage(Builder,ExtensionRegistry)

2009-02-21 Thread Nathaniel

I'm having a hard time with the readMessageFunction on
CodedInputStream
CodedInputStream.readMessage(Builder,ExtensionRegistry)

org.apache.mina.filter.codec.ProtocolDecoderException:
com.google.protobuf.InvalidProtocolBufferException: Protocol message
tag had invalid wire type. (Hexdump: 6F 67 6C 65 2E 63 6F 6D)


My code looked something like this before I ripped it out to simple
use IngestProto.ShareLocation.parseFrom()

   IngestProto.ShareLocation.Builder builder =
IngestProto.ShareLocation.newBuilder();
   builder.setUrl( http://google.com;);
  IngestProto.ShareLocation.Builder builder2 =
IngestProto.ShareLocation.newBuilder();
  CodedInputStream cis = CodedInputStream.newInstance(builder.build
().toArray());
  cis.readMessage( builder2, ExtensionRegistry.getEmptyRegistry());



Any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: Protocol Buffers Compiler Maven Plug-In

2009-01-20 Thread Nathaniel Harward
I don't really consider this slacking; anything going to the open source
community is a public gift and should be treated as such.  I mostly just
want to avoid fragmentation and having three different plugins doing the
same thing, so that it can be focused and as high-quality as possible.  Even
if it has no tests I'd love to see it as an alpha-release plugin, and
perhaps Tom, myself and others can help out with tests and/or enhancements
to bring it to beta and/or release.

As I said I made one for internal use at my workplace and it will satisfy
our needs until this one pops up.  Thanks in advance to you and Tom (and
anyone else working on it); I'd love to see protobuf gain in popularity and
tooling and in particular replace XML where it makes sense (which is a LOT
of places); I just can't take any more inappropriate use of XML in my life
:)

Nat

On Tue, Jan 20, 2009 at 11:12 AM, Gregory Kick g...@google.com wrote:


 I totally understand the frustration.  This had slipped to the bottom
 of the priorities, but I'm actually working on this stuff today.
 Basically, my plan is to check in the plugin today.  The plugin is
 more or less done, but I have no tests.  (ack!)  I would really,
 really, really appreciate it if somebody could contribute some.  As
 soon as I check in the plugin everybody that expressed interest will
 get a notice about a code review.

 Sorry again for the slacking.

 On Tue, Jan 20, 2009 at 12:54 PM, Kenton Varda ken...@google.com wrote:
  [cc Greg to get his attention]
 
  On Tue, Jan 20, 2009 at 9:35 AM, Nat nharw...@gmail.com wrote:
 
  So is this going anywhere?  Bueller...?  Bueller...?
 
  After my last post I was curious to build my first Maven2 plugin, and
  I also now have a working plugin that binds to the generate-sources
  phase like Tom's original post in this thread.  I was just about to
  (ask to) put it on Codehaus but re-read this thread first and realized
  Tom is already in position to do so, so I'll hold off.  However, it
  seems like if this is going to be further delayed maybe it makes sense
  to pursue this option.  Gregory, I'm sure you are a busy man but do
  you have an estimate of when you think you might be able to publish
  this?  Or do you think it's a good idea for either myself or Tom to
  post to Codehaus/elsewhere in the meantime?
 
  Nat
  
 
 

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---