Skip to content

Commit c7085ed

Browse files
committed
Fix ruff issues
1 parent 20d0460 commit c7085ed

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

terminusdb_client/schema/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _check_mismatch_type(prop, prop_value, prop_type):
9898
f"Property {prop} should be of type {prop_type_id} but got value of type {prop_value_id}"
9999
)
100100
else:
101-
if prop_type == int:
101+
if prop_type is int:
102102
prop_value = int(prop_value)
103103
# TODO: This is now broken
104104
# check_type(prop, prop_value, prop_type)
@@ -224,7 +224,7 @@ class DocumentTemplate(metaclass=TerminusClass):
224224
def __setattr__(self, name, value):
225225
if name[0] != "_" and value is not None:
226226
correct_type = self._annotations.get(name)
227-
if correct_type == int:
227+
if correct_type is int:
228228
try:
229229
value = int(value)
230230
except ValueError:

terminusdb_client/scripts/dev.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@
2626
def run_command(cmd, cwd=None, check=True):
2727
"""Run a shell command and return the result."""
2828
print(f"Running: {' '.join(cmd)}")
29-
return subprocess.run(cmd, cwd=cwd, check=check)
29+
try:
30+
result = subprocess.run(cmd, cwd=cwd, check=check, capture_output=True, text=True)
31+
if result.stdout:
32+
print(result.stdout)
33+
return result
34+
except subprocess.CalledProcessError as e:
35+
if e.stdout:
36+
print(e.stdout)
37+
if e.stderr:
38+
print(e.stderr, file=sys.stderr)
39+
# Re-raise with a cleaner message
40+
raise SystemExit(1)
3041

3142

3243
def init():

terminusdb_client/woql_type.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
bool: "xsd:boolean",
3939
float: "xsd:double",
4040
int: "xsd:integer",
41-
long: "xsd:long",
4241
dict: "sys:JSON",
43-
gYear: "xsd:gYear",
4442
dt.datetime: "xsd:dateTime",
4543
dt.date: "xsd:date",
4644
dt.time: "xsd:time",
@@ -68,7 +66,6 @@
6866
nonNegativeInteger : "xsd:nonNegativeInteger",
6967
base64Binary : "xsd:base64Binary",
7068
hexBinary : "xsd:hexBinary",
71-
anyURI : "xsd:anyURI",
7269
language : "xsd:language",
7370
normalizedString : "xsd:normalizedString",
7471
token : "xsd:token",

terminusdb_client/woqlquery/woql_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2850,7 +2850,7 @@ def group_by(self, group_vars, template, output, groupquery=None):
28502850
if self._cursor.get("@type"):
28512851
self._wrap_cursor_with_and()
28522852
self._cursor["@type"] = "GroupBy"
2853-
if not type(group_vars) is list:
2853+
if type(group_vars) is not list:
28542854
group_vars = [group_vars]
28552855
self._cursor["group_by"] = self._raw_var_list(group_vars)
28562856
self._cursor["template"] = self._clean_object(template)

0 commit comments

Comments
 (0)