Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Review no-member error for ProtoBuf #158

Open
rnowling-memphis opened this issue May 28, 2023 · 4 comments
Open

Bug: Review no-member error for ProtoBuf #158

rnowling-memphis opened this issue May 28, 2023 · 4 comments

Comments

@rnowling-memphis
Copy link
Contributor

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
@Adarsh-jaiss
Copy link
Contributor

Adarsh-jaiss commented Jul 11, 2023

@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!

@rnowling-memphis
Copy link
Contributor Author

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!

@Adarsh-jaiss
Copy link
Contributor

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

@Adarsh-jaiss
Copy link
Contributor

Adarsh-jaiss commented Jul 12, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants