Skip to content

Commit

Permalink
0.0.158
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed May 12, 2024
1 parent d876782 commit f8d841d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions orso/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def is_temporal(self):
"""is the type time-based"""
return self in (self.DATE, self.TIME, self.TIMESTAMP)

def is_large_object(self):
"""is the type arbitrary length string"""
return self in (self.VARCHAR, self.BLOB)

def is_complex(self):
return self in (self.ARRAY, self.STRUCT, self.BSON, self.INTERVAL)

def __str__(self):
return self.value

Expand Down
2 changes: 1 addition & 1 deletion orso/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__: str = "0.0.157"
__version__: str = "0.0.158"
__author__: str = "@joocer"
16 changes: 16 additions & 0 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ def test_types_is_temporal():
assert not OrsoTypes.VARCHAR.is_temporal()


def test_types_is_large_object():
# is temporal
assert not OrsoTypes.ARRAY.is_large_object()
assert OrsoTypes.BLOB.is_large_object()
assert not OrsoTypes.BOOLEAN.is_large_object()
assert not OrsoTypes.DATE.is_large_object()
assert not OrsoTypes.DECIMAL.is_large_object()
assert not OrsoTypes.DOUBLE.is_large_object()
assert not OrsoTypes.INTEGER.is_large_object()
assert not OrsoTypes.INTERVAL.is_large_object()
assert not OrsoTypes.STRUCT.is_large_object()
assert not OrsoTypes.TIME.is_large_object()
assert not OrsoTypes.TIMESTAMP.is_large_object()
assert OrsoTypes.VARCHAR.is_large_object()


if __name__ == "__main__": # prgama: nocover
from tests import run_tests

Expand Down

0 comments on commit f8d841d

Please sign in to comment.