Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix object conversion with auto_convert=True #421

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

chernias
Copy link

@chernias chernias commented Dec 8, 2020

Fix for #359

Credit goes to @antoine-guillou:
antoine-guillou@00d8df4

I asked them to create a PR but didn't get a response so creating one myself since it wold be nice to have this.

Signed-off-by: Sergii Cherniavskyi [email protected]

@antoine-guillou
Copy link

Hey,
Sorry I missed your first message.
Would definitely be nice to get that change across. I was not able to run the tests, but it works for my usage.

Copy link
Collaborator

@bartdag bartdag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your pull request and apologies for the long delay.

I made a few suggestions to improve the code and it would be important to add at least one test in java_gateway_test and one test in client_server_test before this pull request can be merged.

Thanks!

@ihleonard-c3
Copy link

@bartdag if I were to pick this up and make the requested changes do you think we could get it merged and released?

Signed-off-by: Sergii Cherniavskyi <[email protected]>
@chernias
Copy link
Author

chernias commented May 6, 2021

@ihleonard-c3 Thanks for bringing this up. Missed the original notification :)

@bartdag I've addressed your comments.

I'm more than happy to run the tests but every time I tried they just seem to hang. Looks like @antoine-guillou had the same issue. Any thoughts on that?
Or maybe there's a more up-to-date readme somewhere?

@bartdag
Copy link
Collaborator

bartdag commented May 6, 2021

I still need to find a better CI environment, but last time I committed code the tests ran fine on Travis-CI and locally on mac and linux. You should be able to at least run the test method you wrote even if the whole test suite does not complete locally.

@ihleonard-c3
Copy link

@ihleonard-c3 Thanks for bringing this up. Missed the original notification :)

Thank you for picking it back up!

@antoine-guillou
Copy link

@chernias yes, I can confirm that my original modifications made some tests in client_server_test.py hang (testJavaGC, testMultiClientServer...) If I revert my changes the tests pass.

If I run the hanging tests in debug, and run the faulty line in the debug console, it does not hang but provides me the error message.

AttributeError: 'NoneType' object has no attribute 'gateway_client

error occuring in clientserver.py where I wrote (~line 584):

if (not isinstance(return_value, JavaObject)) and ( not self.python_server.gateway_client.converters is None):

Testing if self.python_server not None on the same if statement makes the tests in client_server_test.py pass:

if (not isinstance(return_value, JavaObject)) and (self.python_server is not None) and (self.python_server.gateway_client.converters is not None)

Probably easier for you to incorporate this line into your branch than me forking your fork to create a pull request 🙃

chernias added 3 commits May 10, 2021 14:27
Signed-off-by: Sergii Cherniavskyi <[email protected]>
Signed-off-by: Sergii Cherniavskyi <[email protected]>
@chernias
Copy link
Author

@antoine-guillou Thanks! I've added it.
Tests definitely progressed further, but they still get stuck after a few minutes. I'll try to see what's going on when I have time.

@chernias
Copy link
Author

Hey @bartdag.
I've ran nosetests py4j.tests.java_list_test since they include auto convert checks and they seem to be passing.
As mentioned above the whole set still hangs after some time so I'll try to take a look into that.

...
----------------------------------------------------------------------
Ran 12 tests in 30.840s

OK

@ihleonard-c3
Copy link

Just following up again to see if I can help here. Thanks

@ihleonard-c3
Copy link

Bump again

@chernias
Copy link
Author

Hey @bartdag. Do you have any other concerns regarding this or are we good to finally merge? :)

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

Successfully merging this pull request may close these issues.

4 participants