PR Version 2 (Squashed commits)#39
Conversation
Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
Attempt to squash commit into two commit pt 1 Signed-off-by: Jason Plurad <pluradj@us.ibm.com>
|
|
Please verify the committer name, email, and GitHub username association are all correct and match CLA records. |
|
@FlorianHockmann : I squashed all commits in my branck I have also marked resolved a few of Codacy issues raised as those can be ignored while 3 more are remaiing which somehow got mixed while doing rebase. (But Build in Travis are working fine so functionality is good). Can you please review this and let's move this forward? Thanks |
author Misha Brukman <mbrukman@google.com> 1546485694 -0500 committer Debasish Kanhar <dekanhar@in.ibm.com> 1580764411 +0530 Fix Apache license copyright template. This line is not supposed to be a specific copyright holder or year; it's a template line, and should have been transferred as-is from the Apache 2.0 license, which can be found at https://www.apache.org/licenses/LICENSE-2.0.txt Signed-off-by: Misha Brukman <mbrukman@google.com> Applying codacy fixes Signed-off-by: Chris Hupman <chupman@us.ibm.com> Adding codacy code quality badge to README Signed-off-by: Chris Hupman <chupman@us.ibm.com> Initial commit to ignore rebase Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> Remove hardcoded username and password for PyPi deployement from travis.yml. Fixes JanusGraph#28 Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> adding integration test for GeoAttributes Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> added integration tests for geoattributes and doctraversals Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> commented out geo tests so as to test how other integration tests are working Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> adding tests. fixing JanusGraph#19 Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> adding tests. fixing JanusGraph#19 Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> adding changes by @chupman for all shell scripts and travis script Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> resolving conflict in build-docs.sh Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> adding integration test for GeoAttrivutes Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> moving container and traversal start/stop to setup and teardown methods based on @chupman comments Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> changed type from JanusGraphContainer to JanusGraphContainer Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> fresh comments input based on @chupman comments. updated gitignore to skip virtualenv files Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> testing travis on integration_tests Initial commit to ignore rebase Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> Remove hardcoded username and password for PyPi deployement from travis.yml. Fixes JanusGraph#28 Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> adding integration test for GeoAttributes Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> added integration tests for geoattributes and doctraversals Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> commented out geo tests so as to test how other integration tests are working Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> adding tests. fixing JanusGraph#19 Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> adding changes by @chupman for all shell scripts and travis script Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> resolving conflict in build-docs.sh Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> moving container and traversal start/stop to setup and teardown methods based on @chupman comments Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> changed type from JanusGraphContainer to JanusGraphContainer Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> fresh comments input based on @chupman comments. updated gitignore to skip virtualenv files Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> removing usage of Pipe, adding docs in comments for why a Geo shape Tartarus is added for GeoAttribute integration tests Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> updated git email and trying to squash Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> Initial commit to ignore rebase. Fix JanusGraph#21 JanusGraph#28. Integration tests for GetAttributes and doctraversals added Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> fixing rebase conflicts Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> changing to new branch for codacy fixes with CLA yes Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> second pass at codacy fixes Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> updated git email and trying to squash Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> removed python 3.7-dev from travis as this lib doesn't support python3.7 yet in any version removing advanced level features like GeoShaped and GeoPredicates. Added only RelationIdentifier, its unit tests and integration tests Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> Removing few invalid imports Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> trying to resolve codacy errors for BUILDING.md Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> attempt to fix codacy issue using remark in BUILDING & README Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> second pass to fix codacy issues Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> third pass to fix codacy issues Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> update Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com> resolving codacy issues with line spacing in readme & building Signed-off-by: Debasish Kanhar <debasish.kanhar@sstech.us>
|
Issues
======
- Added 9
Complexity increasing per file
==============================
- src/main/python/janusgraph_python/structure/io/GraphsonWriter.py 1
- src/unittest/python/structure/io/GraphsonReader_test.py 4
- src/integrationtest/python/TextAttribute_tests.py 2
- src/unittest/python/core/datatypes/RelationIdentifier_test.py 1
- src/main/python/janusgraph_python/serializer/RelationIdentifierSerializer.py 1
- src/main/python/janusgraph_python/core/attribute/Text.py 1
- src/main/python/janusgraph_python/serializer/RelationIdentifierDeserializer.py 1
- src/unittest/python/serialization/RelationIdentifierSerializer_test.py 1
- build.py 1
- src/main/python/janusgraph_python/driver/ClientBuilder.py 4
- src/unittest/python/structure/io/GraphsonWriter_test.py 4
- src/integrationtest/python/JanusGraphContainer.py 3
- src/main/python/janusgraph_python/structure/io/GraphsonReader.py 1
- src/main/python/janusgraph_python/core/datatypes/RelationIdentifier.py 2
- src/unittest/python/serialization/RelationIdentifierDeserializer_test.py 1
- src/integrationtest/python/DocTraversals_tests.py 1
Clones added
============
- src/integrationtest/python/TextAttribute_tests.py 1
- src/integrationtest/python/DocTraversals_tests.py 1
See the complete overview on Codacy |
| ./build.sh -d false -p /usr/lib/python | ||
| ./build.sh -d false -p python3.6 | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Issue found: [list-item-spacing] Missing new line after list item
|
|
||
| Once done, | ||
| - You can see the built HTML files under `docs/_build/index.html` directory. | ||
| - You can see the build library under `target/dist/janusgraph-python/dist` directory. |
There was a problem hiding this comment.
| # X is version number of JanusGraph Python client supported based on JanusGraph version chosen. | ||
| pip install janusgraph_python=X | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Issue found: [list-item-spacing] Missing new line after list item
FlorianHockmann
left a comment
There was a problem hiding this comment.
I just wanted to review this again, but I cannot build it and I want to be sure that it's possible for everyone to build this locally and that CI is working properly before I review this further.
README.md
Outdated
| | 0.3.1 | 0.1.0 | | ||
| | 0.2.x | Not Released | | ||
|
|
||
| The JanusGraph client follows x.y.z version number, and according to [Semantic Versioning](https://semver.org/) |
There was a problem hiding this comment.
(nitpick) I think this sentence together with the following example could simply be expressed by just writing the JanusGraph version numbers as 0.3.z in the table.
There was a problem hiding this comment.
Was added as example to help newbies understand how symver works, and not to get confused. Can be removed if needed anything is okay :-)
There was a problem hiding this comment.
OK, I personally don't think that users of the library need to understand semver and that seeing 0.1.z -> 0.3.z is already enough to understand the compatibility (like we also do it for JanusGraph itself where the matrix is more complicated), but we can also keep this as is if you prefer it that way. So, feel free to just mark this as resolved.
|
We wanted to merge the PR first into an intermediate branch as it was a really big PR and we wanted to clean up some things after merging the PR. However this new PR is pretty minimalistic so I hope that we can get it in a state where we can release the library directly after merging it, or maybe with minimal work post merge. That's why I think that it's OK to target |
FlorianHockmann
left a comment
There was a problem hiding this comment.
The recent changes you made look good overall, but following PEP 8 is still open in my opinion.
…tions. Need clarification on text package Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
|
@FlorianHockmann : Pushed a commit where I changed the module names to follow PEP8 guidelines. Also changed a few of class variables and methods as well to follow PEP8. I'll now go through each of your remaining comments and check which are resolved (non PEP8 based comments) and which aren't based on those if needed I'll push another commit. |
I would have initially said yes, but then I checked gremlin-python again which seems to use the Gremlin-Java methods 1:1 like |
Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
|
@FlorianHockmann : Pushed a commit. Well we will have for now only The recent commit updates the DOCS based on the changes to class. Have removed redundant methods like Also made few comments w.r.t Do have a look and let me know :-) |
src/unittest/python/serialization/relation_identifier_deserializer_test.py
Outdated
Show resolved
Hide resolved
src/unittest/python/serialization/relation_identifier_serializer_test.py
Outdated
Show resolved
Hide resolved
| def test_mock_serializer(self): | ||
| # Create Mock Object | ||
| mockObj = X | ||
| # Create Mock object's serializer |
There was a problem hiding this comment.
There is dict definition here @mbrukman so don't understand exactly
src/unittest/python/structure/io/graphson/graphson_writer_test.py
Outdated
Show resolved
Hide resolved
| echo "Created virtualenv with -p=${PYTHON_PATH}" | ||
|
|
||
| # Set the constants needed for this project | ||
| source constants.sh |
There was a problem hiding this comment.
Is this file only used here? If it's not used anywhere else, can we just inline it here?
There was a problem hiding this comment.
Well constants.sh is sourced only from build.sh but is used by build.py and docs/conf.py .
Reason I wanted to abstract the constants from build.sh is because after sometime build.sh becomes quite stable and we will be needed to only change contants.sh in future but I'm open to suggestions here
|
BTW, if you want to easily reformat your Python code to comply with PEP8, you can do that with See https://github.com/hhatto/autopep8 for more info. |
Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
|
Pushed a fresh commit resolving few of your comments. Have marked those as resolved. Few more are open for discussion. Please do take a look @mbrukman |
src/main/python/janusgraph_python/structure/io/graphson/graphson_reader_builder.py
Outdated
Show resolved
Hide resolved
src/main/python/janusgraph_python/structure/io/graphson/graphson_writer_builder.py
Outdated
Show resolved
Hide resolved
|
|
||
| """ | ||
|
|
||
| objectIdentifier = GraphSONUtil.formatType(self.GRAPHSON_PREFIX, typeClass) |
There was a problem hiding this comment.
We shall leave it to user to do customNamespace:typeID or janusgraph:MOCK or GraphSONUtil.formatType(prefix, typeID) outside of code is it?
Yes, users don't have to use a namespace at all if they don't want to. So I would just let them specify a type_id and they can use a namespace for that if they want, but they don't have to.
FlorianHockmann
left a comment
There was a problem hiding this comment.
Just made another pass through this and this time also reviewed the unit tests (integration tests and docs are still missing).
src/unittest/python/serialization/relation_identifier_deserializer_test.py
Outdated
Show resolved
Hide resolved
src/unittest/python/serialization/relation_identifier_deserializer_test.py
Outdated
Show resolved
Hide resolved
src/unittest/python/serialization/relation_identifier_serializer_test.py
Show resolved
Hide resolved
src/unittest/python/structure/io/graphson/graphson_writer_test.py
Outdated
Show resolved
Hide resolved
| reader_class.register_deserializer(self.GRAPHSON_BASE_TYPE, self.GRAPHSON_PREFIX, deserializer) | ||
| reader = reader_class.build() | ||
|
|
||
| mock_json = { |
There was a problem hiding this comment.
I just verified we can't use json.dumps() here like you suggested in comment #39 (comment) @FlorianHockmann
I tried doing it as
mock_json = json.dumps({
"@type": "janusgraph:MOCK",
"@value": {"a": 1}
})
and all unit tests started failing. I then verified, graphsonV3d0.py expects the input of toObject to be of dict and not json. Check https://github.com/apache/tinkerpop/blob/b73d2f3c0187dbdabc683260ace5cee17a4342aa/gremlin-python/src/main/python/gremlin_python/structure/io/graphsonV3d0.py#L124
There was a problem hiding this comment.
Looks like we have to use separators=(",", ":") always along with json.dumps() as has been followed as de-facto in gremlin-python tests for testing data types.
I've included those and now I'm able to make unit tests pass when I pass JSON String to methods like readObject and writeObject but I still don't understand why would we want to assert against String and not Dict ? Dict is more generic compared to string, and a single Dict can have multiple representations as we can see by making use of separators.
Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
|
@FlorianHockmann did you get time to have a look at updated commit? |
FlorianHockmann
left a comment
There was a problem hiding this comment.
Sorry that it took so long. I just reviewed the recent changes and they all look good to me. I have now also reviewed the integration tests and added comments there. (Docs are still missing.)
There are however still older comments open that aren't resolved like this one. (It's a bit hard to find comments like this now given the number of comments here. I only found it because I remembered that I commented on that.)
Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
|
@FlorianHockmann : Made another pass through existing comments. Resolved few open ones like Sorry took so long, have a look at fresh commit and do give your review :-) But this PR inspite of having so less files the conversation has become too big. |
Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
…lures Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
…n unix and osx in travis Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
…on osx and win. Will be adding workaround later on Signed-off-by: Debasish Kanhar <dekanhar@in.ibm.com>
|
@FlorianHockmann : Pushed a new commit. The current travis file doesn't catch build failures (maybe because it invokes multiple shell script and each shell script runs a command to build which starts a child process). So I've done changes to build script to catch build failures. Also did changes to travis file so that we can start depreciating python 3.4 as its going to be soon depreciated as well. Added Also plan to add support for building on osx and windows to travis later on. |
FlorianHockmann
left a comment
There was a problem hiding this comment.
The recent changes look good to me. I'm just wondering about this one:
Added allow_job_failures.
Why allow job failures? If Python 3.4 doesn't work any more in a reliable way, then we shouldn't claim support for it and remove it completely.
If we however claim support for it, then the tests have to pass on Travis.
Also plan to add support for building on osx and windows to travis later on.
OK, but please don't add this to this PR. It's better to wait until we have merged this and released a first version of this lib in my opinion before we add anything more.
|
|
||
| installation | ||
| connecting | ||
| text-predicates |
There was a problem hiding this comment.
This seems to contain some elements that aren't in the PR any more.
| Welcome to JanusGraph-Python docs's documentation! | ||
| The documentation covers the following topics where we will learn how to connect a running instance | ||
| of JanusGraph server and few basic usage of JanusGraph specific queries like querying for GeoShape and Text Predicates. | ||
| We will also learn about adding Geoshape to dataset in JanusGraph. |
There was a problem hiding this comment.
adding Geoshape to dataset in JanusGraph sounds a bit strange. I would just write adding GeoShape data to JanusGraph
|
|
||
| Welcome to JanusGraph-Python docs's documentation! | ||
| The documentation covers the following topics where we will learn how to connect a running instance | ||
| of JanusGraph server and few basic usage of JanusGraph specific queries like querying for GeoShape and Text Predicates. |
| @@ -0,0 +1,31 @@ | |||
| .. JanusGraph-Python docs documentation master file, created by | |||
There was a problem hiding this comment.
(nitpick) Shouldn't we remove this comment? It seems to only have the purpose of explaining initially what this file is about, but that isn't needed any more now.
| @@ -0,0 +1,38 @@ | |||
| ======================== | |||
| Installation of Drivers | |||
| edges = g.E().has("reason", Text.textContains("breezes")).next() | ||
| print(edges) | ||
|
|
||
| ==> e[55m-6hc-b2t-3bk][8400-lives->4304] |
There was a problem hiding this comment.
Why aren't the properties also printed here? I think that would be helpful to understand what the predicate matched on.
|
|
||
| ==> {<T.id: 1>: '2dj-37c-9hx-360', 'reason': 'loves fresh breezes', <T.label: 3>: 'lives'} | ||
|
|
||
| edges = g.E().has("reason", Text.textContainsFuzzy("breezs")).has("reason", Text.textContainsFuzzy("luves")).valueMap(True).next() |
There was a problem hiding this comment.
(nitpick) I think this example doesn't provide any additional value beyond the other two examples here so I would remove it.
|
|
||
| This Predicate is part of *Text* package. | ||
| TextContainsPrefix is used to query for where the value | ||
| (if sentence, it is segmented, & any word in segment is considered) |
There was a problem hiding this comment.
This isn't specific to TextContainsPrefix so I wouldn't explain it here. Otherwise, why isn't this also explained for the other TextContains_ predicates?
| TextContainsPrefix is used to query for where the value | ||
| (if sentence, it is segmented, & any word in segment is considered) | ||
| contains the string queries in prefix | ||
| The difference between TextContains and TextContainsPrefix and TextPrefix can be seen in example bellow. |
There was a problem hiding this comment.
TextPrefix wasn't even explained yet.
Why show the differences between these predicates here in the section of a specific predicate? If you want to show differences, then I would do that in the end after having introducing all the predicates on their own.
|
|
||
| .. note:: | ||
| All the bellow examples are based on Graph of the Gods graph which comes pre-packaged with JanusGraph | ||
|
|
There was a problem hiding this comment.
I think there are too many examples below that don't add much value and make the section just longer. I would only provide a single and simple example per predicate and then maybe add a different example just add the end to show differences if that is really necessary (I think the description of the predicates already explains everything).
|
@debasishdebs It has been over a year since the last update here and nearly 3 years since you've created your first PR (#2). Do you plan to get back to this and work through the review comments? |
|
@FlorianHockmann : Hi Florian, I moved from IBM to new company, and due to lot many factors have not been able to give time to this at all. Really sorry for that. Sad thing is, my current schedule will continue till mid of July and won't be able to work on this. Post that I can pick that up, else I was thinking since these are pretty small issues, can we have a 2-3hours working session sometime after July mid and resolve all of your mentioned comments till then? What do you say? If you feel mid July would be late, you can certainly pick it from here and we can close this out, but my availability before July looks really grim. Thanks for understanding, and again sorry for inconvinience. |
|
Closing these 3 PRs as we have just merged another PR which contributed a first version for janusgraph-python. |

It involved Code Changes and the following are the features as part of this PR:
Fixing #19 #22 from previous PRs
Squashed commits into 4 commits (as few as possible with all possible authors) and planning to close #38