lexcql-parser 1.3.1__tar.gz → 1.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lexcql-parser
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: LexCQL Query Grammar and Parser
5
5
  Keywords: LexCQL,FCS,CQL,Query Parser
6
6
  Author: Erik Körner
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lexcql-parser"
3
- version = "1.3.1"
3
+ version = "1.3.2"
4
4
  description = "LexCQL Query Grammar and Parser"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -97,7 +97,7 @@ class Validator(QueryVisitorAdapter[_R], metaclass=ABCMeta):
97
97
 
98
98
  Returns:
99
99
  bool: ``True`` if query in valid, ``False`` if any error was recorded
100
- in the ``.errors`` attribute
100
+ in the ``.errors`` attribute (or in ``.warnings`` if ``.warnings_as_errors``)
101
101
  """
102
102
  # allows to override the query string here
103
103
  if query is not None:
@@ -109,7 +109,11 @@ class Validator(QueryVisitorAdapter[_R], metaclass=ABCMeta):
109
109
 
110
110
  self.visit(node)
111
111
 
112
- return len(self.errors) == 0
112
+ num_issues = len(self.errors)
113
+ if self.warnings_as_errors:
114
+ num_issues += len(self.warnings)
115
+
116
+ return num_issues == 0
113
117
 
114
118
  def is_valid(self, node: QueryNode, *, query: Optional[str] = None) -> bool:
115
119
  """Convenience method that simply calls ``.validate()`` and returns
File without changes