vaticle / typedb-driver-python

TypeDB Driver for Python
https://typedb.com
Apache License 2.0
67 stars 25 forks source link

Introduce Values to support expressions #296

Closed flyingsilverfin closed 1 year ago

flyingsilverfin commented 1 year ago

What is the goal of this PR?

Introduce the 'Value' type, which is returned as the result of an expression's computation. This change follows from https://github.com/vaticle/typeql/pull/260, which outlines the capabilities of the new expression syntax.

Values (representing any of Long, Double, Boolean, String, or DateTime) are returned as part of ConceptMap answers and are subtypes of Concept for the time being. Their main API is made of the .get_value() method and .get_value_vype() method, along with all the standard safe downcasting methods to convert a Concept into a Value, using Concept.is_value() and Concept.as_value().

We also move the import location of ValueType from attribute_type.py to concept.py.

What are the changes implemented in this PR?

typedb-bot commented 1 year ago

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

Code

Architecture