memphis.py icon indicating copy to clipboard operation
memphis.py copied to clipboard

Bug: Review no-member error for ProtoBuf

Open rnowling-memphis opened this issue 1 year ago • 4 comments

Running Pylint on master generates the following error:

memphis/memphis.py:450:23: E1101: Module 'google.protobuf.descriptor_pb2' has no 'FileDescriptorSet' member (no-member)

We should fix this or disable it on a per-line basis using:

# pylint: disable-next=no-member
print("A no-member error will be suppressed for this line

rnowling-memphis avatar May 28 '23 11:05 rnowling-memphis

@rnowling-memphis I looked into the memphis/memphis file on my local machine and after running the pylint test the given error is found on the following lines:

  • bug.py:478:21: E1101: Instance of 'FileDescriptorSet' has no 'file' member (no-member)
  • bug.py:479:23: E1101: Instance of 'FileDescriptorSet' has no 'file' member (no-member)
  • bug.py:482:27: E1101: Instance of 'FileDescriptorSet' has no 'file' member (no-member)

Here's the code snippet, Please have a look into this : Screenshot from 2023-07-12 00-29-50

  • After adding # pylint: disable-next=no-member, on line 478,479,482, The error got fixed!

Adarsh-jaiss avatar Jul 11 '23 18:07 Adarsh-jaiss

Thanks @Adarsh-jaiss ! I'm not sure that disabling the linting error is the right move here without first checking that the code works. In the previous instance, it made sense to disable the error because we explicitly check that the member exists and have an alternative code path if not. Here, we absolutely depend on the file attribute existing. This one will require more work on your end to debug. In particular, it seems like you would need to:

  1. Set up Memphis locally using Docker
  2. Create a station with a protocol buffer-based schemaverse attachment
  3. Modify the memphis.py code to add some print statements or something so you can verify that this code block is run, the file field exists, etc.
  4. Install the SDK into a local virtual environment
  5. Write a simple producer that produces messages in protocol buffer format.

I think this is going to be a fair amount of work. If you don't want to take that on quite yet, I think there is other work that needs to be done that would be much easier. For example, it would be nice to add examples to the function documentation like those for Consumer.fetch() so that we can eventually generate useful API docs. What do you think?

Either way, we value your contributions and thank you!

rnowling-memphis avatar Jul 11 '23 20:07 rnowling-memphis

  • In which issue, is that function reffered to?
  • I would love to work on that issue

Adarsh-jaiss avatar Jul 12 '23 04:07 Adarsh-jaiss

Thanks @Adarsh-jaiss ! I'm not sure that disabling the linting error is the right move here without first checking that the code works. In the previous instance, it made sense to disable the error because we explicitly check that the member exists and have an alternative code path if not. Here, we absolutely depend on the file attribute existing. This one will require more work on your end to debug. In particular, it seems like you would need to:

  1. Set up Memphis locally using Docker
  2. Create a station with a protocol buffer-based schemaverse attachment
  3. Modify the memphis.py code to add some print statements or something so you can verify that this code block is run, the file field exists, etc.
  4. Install the SDK into a local virtual environment
  5. Write a simple producer that produces messages in protocol buffer format.

I think this is going to be a fair amount of work. If you don't want to take that on quite yet, I think there is other work that needs to be done that would be much easier. For example, it would be nice to add examples to the function documentation like those for Consumer.fetch() so that we can eventually generate useful API docs. What do you think?

Either way, we value your contributions and thank you!

Hey @rnowling-memphis

  • I have locally installed the memphsis and now i'm trying to understand the issue and would love to work on this issue!
  • And in the meantime , I'll also be working on the another issues including the one which you talked above
  • please explain the issue you mentioned above in detail, so that i can work on that

Adarsh-jaiss avatar Jul 12 '23 07:07 Adarsh-jaiss