Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Commit ab9b807

Browse files
chewseleneSelene Chew
andauthored
Fix spelling errors (#1014)
Co-authored-by: Selene Chew <[email protected]>
1 parent 93d2cf3 commit ab9b807

File tree

20 files changed

+37
-36
lines changed

20 files changed

+37
-36
lines changed

graphql_compiler/compiler/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def __init__(
357357
self.direction = direction
358358
self.edge_name = edge_name
359359
self.depth = depth
360-
# Denotes whether the traversal is occuring after a prior @optional traversal
360+
# Denotes whether the traversal is occurring after a prior @optional traversal
361361
self.within_optional_scope = within_optional_scope
362362
self.validate()
363363

graphql_compiler/compiler/emit_sql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ def __init__(self, sql_schema_info: SQLAlchemySchemaInfo, ir: IrAndMetadata):
809809
self._relocate(ir.query_metadata_table.root_location)
810810

811811
# Mapping aliases to one of the column used to join into them. We use this column
812-
# to check for LEFT JOIN misses, since it helps us distinguish actuall NULL values
812+
# to check for LEFT JOIN misses, since it helps us distinguish actual NULL values
813813
# from values that are NULL because of a LEFT JOIN miss.
814814
self._came_from: Dict[Union[Alias, ColumnRouter], Column] = {}
815815

graphql_compiler/compiler/ir_lowering_common/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,14 @@ def extract_folds_from_ir_blocks(
266266
def extract_optional_location_root_info(
267267
ir_blocks: List[BasicBlock],
268268
) -> Tuple[List[Location], Dict[Location, Tuple[Location, ...]]]:
269-
"""Construct a mapping from locations within @optional to their correspoding optional Traverse.
269+
"""Construct a mapping from locations within @optional to their corresponding optional Traverse.
270270
271271
Args:
272272
ir_blocks: list of IR blocks to extract optional data from
273273
274274
Returns:
275275
tuple (complex_optional_roots, location_to_optional_roots):
276-
complex_optional_roots: list of @optional locations (location immmediately preceding
276+
complex_optional_roots: list of @optional locations (location immediately preceding
277277
an @optional Traverse) that expand vertex fields
278278
location_to_optional_roots: dict mapping from location -> optional_roots where location is
279279
within some number of @optionals and optional_roots is a tuple
@@ -362,7 +362,7 @@ def extract_simple_optional_location_info(
362362
363363
Args:
364364
ir_blocks: list of IR blocks to extract optional data from
365-
complex_optional_roots: list of @optional locations (location immmediately preceding
365+
complex_optional_roots: list of @optional locations (location immediately preceding
366366
an @optional traverse) that expand vertex fields
367367
location_to_optional_roots: dict mapping from location -> optional_roots where location is
368368
within some number of @optionals and optional_roots is a tuple
@@ -371,7 +371,7 @@ def extract_simple_optional_location_info(
371371
372372
Returns:
373373
dict mapping from simple_optional_root_location -> dict containing keys
374-
- 'inner_location': Location object correspoding to the unique MarkLocation present within
374+
- 'inner_location': Location object corresponding to the unique MarkLocation present within
375375
a simple optional (one that does not expand vertex fields) scope
376376
- 'edge_field': string representing the optional edge being traversed
377377
where simple_optional_root_to_inner_location is the location preceding the @optional scope

graphql_compiler/compiler/ir_lowering_gremlin/ir_lowering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def to_gremlin(self):
315315

316316

317317
class GremlinFoldedLocalField(LocalField):
318-
"""A Gremlin-specific LocalField expressionto be used only within @fold scopes."""
318+
"""A Gremlin-specific LocalField expression to be used only within @fold scopes."""
319319

320320
def get_local_object_gremlin_name(self):
321321
"""Return the Gremlin name of the local object whose field is being produced."""

graphql_compiler/compiler/ir_lowering_match/ir_lowering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def _translate_equivalent_locations(
326326
def lower_folded_coerce_types_into_filter_blocks(
327327
folded_ir_blocks: List[BasicBlock],
328328
) -> List[BasicBlock]:
329-
"""Lower CoerceType blocks into "INSTANCEOF" Filter blocks. Indended for folded IR blocks."""
329+
"""Lower CoerceType blocks into "INSTANCEOF" Filter blocks. Intended for folded IR blocks."""
330330
new_folded_ir_blocks: List[BasicBlock] = []
331331
for block in folded_ir_blocks:
332332
new_block: BasicBlock

graphql_compiler/compiler/ir_lowering_match/optional_traversal.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def _prune_traverse_using_omitted_locations(
3737
Args:
3838
match_traversal: list of MatchStep objects to be pruned
3939
omitted_locations: subset of complex_optional_roots to be omitted
40-
complex_optional_roots: list of all @optional locations (location immmediately preceding
40+
complex_optional_roots: list of all @optional locations (location immediately preceding
4141
an @optional traverse) that expand vertex fields
4242
location_to_optional_roots: dict mapping from location -> optional_roots where location is
4343
within some number of @optionals and optional_roots is a list
@@ -64,7 +64,7 @@ def _prune_traverse_using_omitted_locations(
6464
)
6565
)
6666
elif optional_root_location in omitted_locations:
67-
# Add filter to indicate that the omitted edge(s) shoud not exist
67+
# Add filter to indicate that the omitted edge(s) should not exist
6868
field_name = step.root_block.get_field_name()
6969

7070
# HACK(predrag): Plumbing in the type here is tricky and generally not worth it,
@@ -208,7 +208,7 @@ def _get_present_locations(match_traversals):
208208
if not present_non_optional_locations.issubset(present_locations):
209209
raise AssertionError(
210210
"present_non_optional_locations {} was not a subset of "
211-
"present_locations {}. THis hould never happen.".format(
211+
"present_locations {}. This should never happen.".format(
212212
present_non_optional_locations, present_locations
213213
)
214214
)
@@ -354,7 +354,7 @@ def _apply_filters_to_first_location_occurrence(
354354
new_match_traversal = []
355355
newly_filtered_locations = set()
356356
for match_step in match_traversal:
357-
# Apply all filters for a location to the first occurence of that location
357+
# Apply all filters for a location to the first occurrence of that location
358358
current_location = match_step.as_block.location
359359

360360
if current_location in newly_filtered_locations:
@@ -394,8 +394,8 @@ def _apply_filters_to_first_location_occurrence(
394394
def collect_filters_to_first_location_occurrence(compound_match_query):
395395
"""Collect all filters for a particular location to the first instance of the location.
396396
397-
Adding edge field non-exsistence filters in `_prune_traverse_using_omitted_locations` may
398-
result in filters being applied to locations after their first occurence.
397+
Adding edge field non-existence filters in `_prune_traverse_using_omitted_locations` may
398+
result in filters being applied to locations after their first occurrence.
399399
OrientDB does not resolve this behavior correctly. Therefore, for each MatchQuery,
400400
we collect all the filters for each location in a list. For each location,
401401
we make a conjunction of the filter list (`_predicate_list_to_where_block`) and apply
@@ -566,7 +566,7 @@ def _lower_non_existent_context_field_filters(match_traversals, visitor_fn):
566566
The `visitor_fn` implements these behaviors (see `_update_context_field_expression`).
567567
568568
Args:
569-
match_traversals: list of match traversal enitities to be lowered
569+
match_traversals: list of match traversal entities to be lowered
570570
visitor_fn: visit_and_update function for lowering expressions in given match traversal
571571
572572
Returns:
@@ -592,7 +592,7 @@ def _lower_non_existent_context_field_filters(match_traversals, visitor_fn):
592592

593593

594594
def lower_context_field_expressions(compound_match_query):
595-
"""Lower Expressons involving non-existent ContextFields."""
595+
"""Lower Expressions involving non-existent ContextFields."""
596596
if len(compound_match_query.match_queries) == 0:
597597
raise AssertionError(
598598
"Received CompoundMatchQuery {} with no MatchQuery objects.".format(
@@ -601,7 +601,7 @@ def lower_context_field_expressions(compound_match_query):
601601
)
602602
elif len(compound_match_query.match_queries) == 1:
603603
# All ContextFields exist if there is only one MatchQuery
604-
# becuase none of the traverses were omitted, and all locations exist (are defined).
604+
# because none of the traverses were omitted, and all locations exist (are defined).
605605
return compound_match_query
606606
else:
607607
new_match_queries = []

graphql_compiler/compiler/ir_lowering_match/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _filter_orientdb_simple_optional_edge(
171171
"""Return an Expression that is False for rows that don't follow the @optional specification.
172172
173173
OrientDB does not filter correctly within optionals. Namely, a result where the optional edge
174-
DOES EXIST will be returned regardless of whether the inner filter is satisfed.
174+
DOES EXIST will be returned regardless of whether the inner filter is satisfied.
175175
To mitigate this, we add a final filter to reject such results.
176176
A valid result must satisfy either of the following:
177177
- The location within the optional exists (the filter will have been applied in this case)
@@ -245,7 +245,7 @@ def construct_where_filter_predicate(
245245
are folded or optional).
246246
simple_optional_root_info: dict mapping from simple_optional_root_location -> dict
247247
containing keys
248-
- 'inner_location': Location object correspoding to the
248+
- 'inner_location': Location object corresponding to the
249249
unique MarkLocation present within a
250250
simple @optional (one that does not
251251
expand vertex fields) scope
@@ -287,7 +287,7 @@ class OptionalTraversalTree(object):
287287
def __init__(self, complex_optional_roots: List[Location]):
288288
"""Initialize empty tree of optional root Locations (elements of complex_optional_roots).
289289
290-
This object construst a tree of complex optional roots. These are locations preceding an
290+
This object constructs a tree of complex optional roots. These are locations preceding an
291291
@optional traverse that expand vertex fields within. Simple @optional traverses i.e.
292292
ones that do not expand vertex fields within them are excluded.
293293
@@ -393,7 +393,7 @@ def construct_optional_traversal_tree(
393393
"""Return a tree of complex optional root locations.
394394
395395
Args:
396-
complex_optional_roots: list of @optional locations (location immmediately preceding
396+
complex_optional_roots: list of @optional locations (location immediately preceding
397397
an @optional Traverse) that expand vertex fields
398398
location_to_optional_roots: dict mapping from location -> optional_roots where location is
399399
within some number of @optionals and optional_roots is a list

graphql_compiler/compiler/sqlalchemy_extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,5 @@ def bind_parameters_to_query_string(
121121

122122

123123
def materialize_result_proxy(result: sqlalchemy.engine.result.ResultProxy) -> List[Dict[str, Any]]:
124-
"""Drain the results from a result proxy into a list of dicts represenation."""
124+
"""Drain the results from a result proxy into a list of dicts representation."""
125125
return [dict(row) for row in result]

graphql_compiler/macros/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def register_macro_edge(macro_registry, macro_edge_graphql, macro_edge_args):
117117
requires in order to function.
118118
"""
119119
# The below function will validate that the macro edge in question is valid in isolation,
120-
# when considered only against the macro-less schema. After geting this result,
120+
# when considered only against the macro-less schema. After getting this result,
121121
# we simply need to check the macro edge descriptor against other artifacts in the macro system
122122
# that might also cause conflicts.
123123
macro_descriptor = make_macro_edge_descriptor(

graphql_compiler/macros/macro_edge/expansion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _expand_specific_macro_edge(subclass_sets, target_class_name, macro_ast, sel
141141
to be added somewhere in the same scope but before the replacement_selection_ast.
142142
- sibling_suffix_selections: list of GraphQL AST objects describing the selections
143143
to be added somewhere in the same scope but after the replacement_selection_ast.
144-
Since the replacemet_selection_ast is a vertex field, and vertex fields always
144+
Since the replacement_selection_ast is a vertex field, and vertex fields always
145145
go after property fields, these selections are all vertex fields.
146146
"""
147147
replacement_selection_ast = None

0 commit comments

Comments
 (0)