-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ms/bdd concepts #90
Ms/bdd concepts #90
Conversation
…ient.jl into ms/bdd-concepts
implemented
case something whent wrong by quering something
implemented relation_type_get_relates_for_role_label and the necessary functions for this.
implemented
are worked through. The debugging is open.
graql part were deleted because they are not relevant for now.
using TypQL.
ProtoBuf files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great PR! I don't have much to say about logic and BDDs and so I left some minor comments and formatting suggestions.
Project.toml
Outdated
@@ -9,13 +9,19 @@ DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" | |||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | |||
Pretend = "8ad1c615-040c-41b0-a18f-ae9e9fd09b5b" | |||
ProtoBuf = "3349acd9-ac6a-5e09-bcdb-63829b23a429" | |||
SnoopCompile = "aa65fe97-06da-5843-b5b1-d5d13cad87d2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is SnoopCompile needed here or in the global env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. Only a relict from working on starting time.
protocol_translation.jl
Outdated
@@ -1,7 +1,7 @@ | |||
using Pkg | |||
using ProtoBuf | |||
|
|||
root_dir_java = "/Users/frank/Documents/JuliaProjects/JuliaSource/TypeDBClient/client-java" | |||
# root_dir_java = "/Users/frank/Documents/JuliaProjects/JuliaSource/TypeDBClient/client-java" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just delete this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/common/rpc/RequestBuilder.jl
Outdated
|
||
function _treq(; kwargs...) | ||
return Proto.Transaction_Req( | ||
concept_manager_req = Proto.ConceptManager_Req(; kwargs...) | ||
) | ||
end | ||
|
||
function put_entity_type_req(label::String) | ||
function put_entity_type_req(label::Optional{String}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we handle nothing
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. I think this was only a try to solve a problem. Changed back
src/common/rpc/RequestBuilder.jl
Outdated
Proto.RelationType_SetRelates_Req(; | ||
label = role_label, | ||
overridden_label) : | ||
Proto.RelationType_SetRelates_Req(; | ||
label = role_label) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor formatting issue. Only a single indent from prior line is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope, I changed it right yet.
src/common/rpc/TypeDBStub.jl
Outdated
@@ -22,5 +22,5 @@ function Cluster_TypeDBStub(channel::gRPCClient.gRPCChannel) | |||
end | |||
|
|||
function ensure_connected(stub::T) where {T<:AbstractTypeDBStub} | |||
throw(TypeDBClientException(GENERAL_UNKOWN_ERROR,"function TypeDBStub.jl/ensure_onnected isn't implemented yet")) | |||
throw(TypeDBClientException(GENERAL_UNKOWN_ERROR,"function TypeDBStub.jl/ensure_connected isn't implemented yet")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stack trace would have shown the file path anyways. I would just change the message string to Not implemented yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/core/CoreSession.jl
Outdated
req = SessionRequestBuilder.close_req(session.sessionID) | ||
stub = session.client.core_stub.blockingStub | ||
Proto.session_close(stub, gRPCController(), req ) | ||
if session_alive === true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if session_alive === true | |
if session_alive |
src/core/CoreTransaction.jl
Outdated
@@ -58,13 +58,28 @@ end | |||
|
|||
function query(transaction::T, request::R, batch::Bool) where {T<:AbstractCoreTransaction, R<:Proto.ProtoType} | |||
!is_open(transaction) && throw(TypeDBClientException(CLIENT_TRANSACTION_CLOSED)) | |||
result = single_request(transaction.bidirectional_stream, request, batch) | |||
result = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not type stable. Same comment for stream
function below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right and now it is changed.
src/core/CoreTransaction.jl
Outdated
@@ -78,6 +93,7 @@ function close(transaction::T)::Bool where {T<:AbstractCoreTransaction} | |||
delete!(transaction.session, transaction.transaction_id) | |||
catch ex | |||
throw(TypeDBClientException("something went wrong closing Transaction", ex)) | |||
return false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line would never be reached since it throws right above...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@then("entity(person) get instances is empty") do context | ||
attr = g.get(context[:cm], EntityType, "person") | ||
res_ent = g.get_instances(g.as_remote(attr, context[:transaction])) | ||
@expect isempty(res_ent) === true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the function clearly returns bool, there is no need to compare with true
. Same comment for a few other cases below.
@expect isempty(res_ent) === true | |
@expect isempty(res_ent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For today it isn't possible to formulate only a variable which contains a Bool in the expect section. A issue is filed and a PR to reach the goal is submitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erik has merged the change what made it possible to fulfill your suggestion.
try | ||
set_has(context[:transaction], context[:a], context[:bob]) | ||
catch ex | ||
@expect ex !== nothing | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you care about the type/cause of exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Here only the occurence of an exception counts.
Codecov Report
@@ Coverage Diff @@
## main #90 +/- ##
==========================================
+ Coverage 0.00% 25.30% +25.30%
==========================================
Files 10 50 +40
Lines 5488 7611 +2123
==========================================
+ Hits 0 1926 +1926
- Misses 5488 5685 +197
Continue to review full report at Codecov.
|
documentation purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor comments. OK to merge now if you wish.
docs/src/contributing.md
Outdated
@@ -8,9 +8,9 @@ CurrentModule = TypeDBClient | |||
|
|||
So, TypeDB itself provides various ways how to communicate (read from & write to) with the database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, TypeDB itself provides various ways how to communicate (read from & write to) with the database. | |
So, TypeDB itself provides various ways how to communicate (read from & write to) the database. |
src/contribution/contribution.jl
Outdated
using ..TypeDBClient | ||
|
||
g = TypeDBClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean... It seems ok to me? If not, you can at least make g
a const.
julia> module Foo
foo() = 1
module Bar
import ..Foo as g
bar() = g.foo()
end
end
Main.Foo
julia> Foo.Bar.bar()
1
Please squash when you merge to main branch. Thanks |
This is the PR for the fully implemented BDD tests. Some changes were needed to accomplish the goal. Hints, suggestions and questions are very appreciated.