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

Implement RequestBuilder, Thing & Type concepts #63

Merged
merged 2 commits into from
Apr 11, 2021
Merged

Conversation

tk3369
Copy link
Member

@tk3369 tk3369 commented Apr 11, 2021

I think it's better to merge to main branch before the snowball rolls too big... so I'm submitting this PR.

Current status

  • RequesterBuilder is complete but missing some unit tests.
  • Concept types and things - local functions are done, remote functions are pending
  • Concept answer - not started yet
  • Concept manager - not started yet (has some pre-existing code that should be refactored)

I added Pretend.jl as a dependency. It's a mocking framework from me :-) The reason is that I want to create unit tests without having to test against a real server. An example can be found at test/unit/test_concepts.jl.

Copy link
Member

@mkschulze mkschulze left a comment

Choose a reason for hiding this comment

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

File name looks like having one l too much.

src/concept/ConceptManagerl.jl

@mkschulze mkschulze added the Implementation New implementation step label Apr 11, 2021
@mkschulze mkschulze added this to In progress in TypeDBClient V1 via automation Apr 11, 2021
@mkschulze mkschulze added this to the Version 1.0 milestone Apr 11, 2021
TypeDBClient V1 automation moved this from In progress to Reviewer approved Apr 11, 2021
Return value will be a subtype of `AbstractType`.
"""
function instantiate(t::Proto._Type)
label = hasproperty(t, :scope) ? Label(t.scope, t.label) : Label(t.label)
Copy link
Member

Choose a reason for hiding this comment

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

Is it :scope or ::scope?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's :scope, a symbol. That's how you test if a property exists in an object. Unlike a normal Julia struct fields, a ProtoBuf codegen object will report the existence of a property only after you set a value for that property. So an empty object would not have any property.

@mkschulze mkschulze merged commit 96f293c into main Apr 11, 2021
TypeDBClient V1 automation moved this from Reviewer approved to Done Apr 11, 2021
@tk3369 tk3369 deleted the tk/request-builder branch April 18, 2021 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation New implementation step
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants