Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
loopy
Commits
ebd1bf99
Commit
ebd1bf99
authored
7 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Re-improve: type inf error messages for invalid aggregate lookups
parent
68a3611d
No related branches found
No related tags found
1 merge request
!115
Fix domain tree branch detection
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loopy/type_inference.py
+10
-2
10 additions, 2 deletions
loopy/type_inference.py
with
10 additions
and
2 deletions
loopy/type_inference.py
+
10
−
2
View file @
ebd1bf99
...
@@ -332,13 +332,21 @@ class TypeInferenceMapper(CombineMapper):
...
@@ -332,13 +332,21 @@ class TypeInferenceMapper(CombineMapper):
if
not
agg_result
:
if
not
agg_result
:
return
agg_result
return
agg_result
fields
=
agg_result
[
0
].
numpy_dtype
.
fields
numpy_dtype
=
agg_result
[
0
].
numpy_dtype
fields
=
numpy_dtype
.
fields
if
fields
is
None
:
if
fields
is
None
:
raise
LoopyError
(
"
cannot look up attribute
'
%s
'
in
"
raise
LoopyError
(
"
cannot look up attribute
'
%s
'
in
"
"
non-aggregate expression
'
%s
'"
"
non-aggregate expression
'
%s
'"
%
(
expr
.
aggregate
,
expr
.
name
))
%
(
expr
.
aggregate
,
expr
.
name
))
dtype
=
fields
[
0
]
try
:
field
=
fields
[
expr
.
name
]
except
KeyError
:
raise
LoopyError
(
"
cannot look up attribute
'
%s
'
in
"
"
aggregate expression
'
%s
'
of dtype
'
%s
'"
%
(
expr
.
aggregate
,
expr
.
name
,
numpy_dtype
))
dtype
=
field
[
0
]
return
[
NumpyType
(
dtype
)]
return
[
NumpyType
(
dtype
)]
def
map_comparison
(
self
,
expr
):
def
map_comparison
(
self
,
expr
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment