RhodiumGroup / docker_images

Docker images for Rhodium's jupyterlab deployments
2 stars 2 forks source link

datashader+dask.dataframe resulting in TypingError #112

Open delgadom opened 4 years ago

delgadom commented 4 years ago

Seemingly normal workflow results in a new, super crazy error:

client,cluster = rhgk.get_standard_cluster()
_ = cluster.scale(20)
attom = ddf.read_parquet('/gcs/rhg-data/impactlab-rhg/common_data/properties/attom/attom_preferred_national.parquet')
attom = attom.persist()
agg = csv.points(
    attom,
    'property_longitude',
    'property_latitude',
    dsh.sum('masked_current_market_value'))
---------------------------------------------------------------------------
TypingError                               Traceback (most recent call last)
<ipython-input-30-00bdd2f5b807> in <module>
      3     'property_longitude',
      4     'property_latitude',
----> 5     dsh.sum('masked_current_market_value'))

/opt/conda/lib/python3.7/site-packages/datashader/core.py in points(self, source, x, y, agg)
    173                 x_range=self.x_range, y_range=self.y_range)
    174 
--> 175         return bypixel(source, self, Point(x, y), agg)
    176 
    177     def line(self, source, x, y, agg=None, axis=0):

/opt/conda/lib/python3.7/site-packages/datashader/core.py in bypixel(source, canvas, glyph, agg)
   1017     with np.warnings.catch_warnings():
   1018         np.warnings.filterwarnings('ignore', r'All-NaN (slice|axis) encountered')
-> 1019         return bypixel.pipeline(source, schema, canvas, glyph, agg)
   1020 
   1021 

/opt/conda/lib/python3.7/site-packages/datashader/utils.py in __call__(self, head, *rest, **kwargs)
     80         typ = type(head)
     81         if typ in lk:
---> 82             return lk[typ](head, *rest, **kwargs)
     83         for cls in getmro(typ)[1:]:
     84             if cls in lk:

/opt/conda/lib/python3.7/site-packages/datashader/dask.py in dask_pipeline(df, schema, canvas, glyph, summary)
     18 @bypixel.pipeline.register(dd.DataFrame)
     19 def dask_pipeline(df, schema, canvas, glyph, summary):
---> 20     dsk, name = glyph_dispatch(glyph, df, schema, canvas, summary)
     21 
     22     # Get user configured scheduler (if any), or fall back to default

/opt/conda/lib/python3.7/site-packages/datashader/utils.py in __call__(self, head, *rest, **kwargs)
     83         for cls in getmro(typ)[1:]:
     84             if cls in lk:
---> 85                 return lk[cls](head, *rest, **kwargs)
     86         raise TypeError("No dispatch for {0} type".format(typ))
     87 

/opt/conda/lib/python3.7/site-packages/datashader/dask.py in default(glyph, df, schema, canvas, summary)
     63 @glyph_dispatch.register(Glyph)
     64 def default(glyph, df, schema, canvas, summary):
---> 65     shape, bounds, st, axis = shape_bounds_st_and_axis(df, canvas, glyph)
     66 
     67     # Compile functions

/opt/conda/lib/python3.7/site-packages/datashader/dask.py in shape_bounds_st_and_axis(df, canvas, glyph)
     46     height = canvas.plot_height
     47 
---> 48     x_st = canvas.x_axis.compute_scale_and_translate(x_range, width)
     49     y_st = canvas.y_axis.compute_scale_and_translate(y_range, height)
     50     st = x_st + y_st

/opt/conda/lib/python3.7/site-packages/datashader/core.py in compute_scale_and_translate(self, range, n)
     53         s, t : floats
     54         """
---> 55         start, end = map(self.mapper, range)
     56         s = n/(end - start)
     57         t = -start * s

/opt/conda/lib/python3.7/site-packages/numba/dispatcher.py in _compile_for_args(self, *args, **kws)
    399                 e.patch_message(msg)
    400 
--> 401             error_rewrite(e, 'typing')
    402         except errors.UnsupportedError as e:
    403             # Something unsupported is present in the user code, add help info

/opt/conda/lib/python3.7/site-packages/numba/dispatcher.py in error_rewrite(e, issue_type)
    342                 raise e
    343             else:
--> 344                 reraise(type(e), e, None)
    345 
    346         argtypes = []

/opt/conda/lib/python3.7/site-packages/numba/six.py in reraise(tp, value, tb)
    666             value = tp()
    667         if value.__traceback__ is not tb:
--> 668             raise value.with_traceback(tb)
    669         raise value
    670 

TypingError: Failed in nopython mode pipeline (step: nopython frontend)
non-precise type pyobject
[1] During: typing of argument at /opt/conda/lib/python3.7/site-packages/datashader/core.py (96)

File "../../../../../opt/conda/lib/python3.7/site-packages/datashader/core.py", line 96:
    def mapper(val):
        return val
        ^

This error may have been caused by the following argument(s):
- argument 0: cannot determine Numba type of <class 'xarray.core.dataarray.DataArray'>

This is not usually a problem with Numba itself but instead often caused by
the use of unsupported features or an issue in resolving types.

To see Python/NumPy features supported by the latest release of Numba visit:
http://numba.pydata.org/numba-doc/latest/reference/pysupported.html
and
http://numba.pydata.org/numba-doc/latest/reference/numpysupported.html

For more information about typing errors and how to debug them visit:
http://numba.pydata.org/numba-doc/latest/user/troubleshoot.html#my-code-doesn-t-compile

If you think your code should work with Numba, please report the error message
and traceback, along with a minimal reproducer at:
https://github.com/numba/numba/issues/new

This error may have been caused by the following argument(s):
- argument 0: cannot determine Numba type of <class 'xarray.core.dataarray.DataArray'>

This is not usually a problem with Numba itself but instead often caused by
the use of unsupported features or an issue in resolving types.

To see Python/NumPy features supported by the latest release of Numba visit:
http://numba.pydata.org/numba-doc/latest/reference/pysupported.html
and
http://numba.pydata.org/numba-doc/latest/reference/numpysupported.html

For more information about typing errors and how to debug them visit:
http://numba.pydata.org/numba-doc/latest/user/troubleshoot.html#my-code-doesn-t-compile

If you think your code should work with Numba, please report the error message
and traceback, along with a minimal reproducer at:
https://github.com/numba/numba/issues/new

This error may have been caused by the following argument(s):
- argument 0: cannot determine Numba type of <class 'xarray.core.dataarray.DataArray'>

This is not usually a problem with Numba itself but instead often caused by
the use of unsupported features or an issue in resolving types.

To see Python/NumPy features supported by the latest release of Numba visit:
http://numba.pydata.org/numba-doc/latest/reference/pysupported.html
and
http://numba.pydata.org/numba-doc/latest/reference/numpysupported.html

For more information about typing errors and how to debug them visit:
http://numba.pydata.org/numba-doc/latest/user/troubleshoot.html#my-code-doesn-t-compile

If you think your code should work with Numba, please report the error message
and traceback, along with a minimal reproducer at:
https://github.com/numba/numba/issues/new