internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: blaze/blaze

Issue:
boolean evaluation with non-comparable types has an odd return type
This seems buggy to me

```
In [1]: df = DataFrame([['Alice', 100, 1],
   ...:                 ['Bob', 200, 2],
   ...:                 ['Alice', 50, 3]], columns=['name', 'amount', 'id'])

In [2]: from blaze import *

In [3]: t = Data(df)

In [4]: t
Out[4]: 
    name  amount  id
0  Alice     100   1
1    Bob     200   2
2  Alice      50   3

# this should raise TypeError or at the very least return a blaze expression
In [5]: t.id=='foo'
Out[5]: False

In [6]: t.id==3    
Out[6]: 
      id
0  False
1  False
2   True

In [7]: type(t.id==3)
Out[7]: blaze.expr.arithmetic.Eq

In [8]: type(t.id=='foo')
Out[8]: bool
```



Discussion:
Should definitely be a `TypeError`


Resolving patch:
diff --git a/blaze/expr/core.py b/blaze/expr/core.py
--- a/blaze/expr/core.py
+++ b/blaze/expr/core.py
@@ -136,9 +136,11 @@ def __eq__(self, other):
         ident = self.isidentical(other)
         if ident is True:
             return ident
+
         try:
             return self._eq(other)
-        except:
+        except AttributeError:
+            # e.g., we can't compare whole tables to other things (yet?)
             pass
         return False
 


Test patch:
diff --git a/blaze/tests/test_interactive.py b/blaze/tests/test_interactive.py
--- a/blaze/tests/test_interactive.py
+++ b/blaze/tests/test_interactive.py
@@ -11,6 +11,7 @@
 import sys
 
 import pandas as pd
+import pandas.util.testing as tm
 import numpy as np
 
 data = (('Alice', 100),
@@ -229,6 +230,7 @@ def test_can_trivially_create_pytables():
     with Data(example('accounts.h5')+'::/accounts') as d:
         assert d is not None
 
+
 def test_data_passes_kwargs_to_resource():
     assert Data(example('iris.csv'), encoding='ascii').data.encoding == 'ascii'
 
@@ -244,6 +246,7 @@ def test_data_on_iterator_refies_data():
     with Data(iter(data)) as d:
         assert d is not None
 
+
 def test_Data_on_json_is_concrete():
     d = Data(example('accounts-streaming.json'))
 
@@ -261,3 +264,14 @@ def test_generator_reprs_concretely():
     d = Data(x)
     expr = d[d > 2] + 1
     assert '4' in repr(expr)
+
+
+def test_incompatible_types():
+    d = Data(pd.DataFrame(L, columns=['id', 'name', 'amount']))
+
+    with pytest.raises(ValueError):
+        d.id == 'foo'
+
+    result = compute(d.id == 3)
+    expected = pd.Series([False, False, True, False, False], name='id')
+    tm.assert_series_equal(result, expected)
Repository: blaze/blaze

Issue:
Spark DataFrame Join should use the native implementation
Right now we do something like this

``` python

@dispatch(Join, SparkDataFrame, SparkDataFrame)
def compute_up(expr, lhs, rhs, **kwargs):
    return compute_up(expr, lhs.rdd, rhs.rdd, **kwargs)
```

Which doesn't use the native Spark DataFrame join implementation. I don't think it would be that difficult to use the native implementation. We just have to be careful about how we deal with post-join column selection. The code that does this for plain RDDs can probably be abstracted into a separate function. It may already exist in that form as well.



Discussion:

Resolving patch:
diff --git a/blaze/compute/spark.py b/blaze/compute/spark.py
--- a/blaze/compute/spark.py
+++ b/blaze/compute/spark.py
@@ -138,13 +138,6 @@ def jgetattr(data, attr, default=None):
         return default
 
 
-@compute_up.register(Join, SparkDataFrame, SparkDataFrame)
-def spark_df_join(t, lhs, rhs, **kwargs):
-    # ship to rdd land, so we can reuse handling of combining records code
-    rdd = compute_up(t, lhs.rdd, rhs.rdd, **kwargs)
-    return lhs.sql_ctx.createDataFrame(rdd)
-
-
 @compute_up.register(Join, RDD, RDD)
 def spark_join(t, lhs, rhs, **kwargs):
     on_left = rowfunc(t.lhs[t.on_left])
diff --git a/blaze/compute/sparksql.py b/blaze/compute/sparksql.py
--- a/blaze/compute/sparksql.py
+++ b/blaze/compute/sparksql.py
@@ -8,14 +8,17 @@
 
 from __future__ import absolute_import, division, print_function
 
+from operator import and_
+
 from toolz import pipe
 from toolz.curried import filter, map
 
 from ..dispatch import dispatch
-from ..expr import Expr, symbol
+from ..expr import Expr, symbol, Join
 from .core import compute
 from .utils import literalquery, istable, make_sqlalchemy_table
-from .spark import Dummy
+from ..utils import listpack
+from .spark import Dummy, jgetattr
 
 __all__ = []
 
@@ -26,6 +29,30 @@
 except ImportError:
     SQLContext = Dummy
 
+try:
+    from pyspark.sql import DataFrame as SparkDataFrame
+except ImportError:
+    SparkDataFrame = Dummy
+
+
+join_types = {
+    'left': 'left_outer',
+    'right': 'right_outer'
+}
+
+
+@dispatch(Join, SparkDataFrame, SparkDataFrame)
+def compute_up(t, lhs, rhs, **kwargs):
+    ands = [getattr(lhs, left) == getattr(rhs, right)
+            for left, right in zip(*map(listpack, (t.on_left, t.on_right)))]
+
+    joined = lhs.join(rhs, reduce(and_, ands), join_types.get(t.how, t.how))
+
+    prec, sec = (rhs, lhs) if t.how == 'right' else (lhs, rhs)
+    cols = [jgetattr(prec, f, jgetattr(sec, f, None)) for f in t.fields]
+    assert all(c is not None for c in cols)
+    return joined.select(*cols)
+
 
 @dispatch(Expr, SQLContext)
 def compute_down(expr, data, **kwargs):


Test patch:
Repository: blaze/blaze

Issue:
cytoolz is required to import blaze, but it's not listed in requirements_strict.txt
In a fresh virtualenv, `pip install blaze && python -c "import blaze"` fails with:

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ssanderson/.virtualenvs/blaze/local/lib/python2.7/site-packages/blaze/__init__.py", line 18, in <module>
    from .utils import ignoring
  File "/home/ssanderson/.virtualenvs/blaze/local/lib/python2.7/site-packages/blaze/utils.py", line 7, in <module>
    from cytoolz import nth
ImportError: No module named cytoolz
```

Is there a reason cytoolz isn't in the strict requirements if it's necessary to even import the top-level module?



Discussion:
Looks like a bug. We should probably just catch the import error and use `toolz`.


Resolving patch:
diff --git a/blaze/utils.py b/blaze/utils.py
--- a/blaze/utils.py
+++ b/blaze/utils.py
@@ -4,7 +4,11 @@
 import datetime
 from functools import wraps
 
-from cytoolz import nth
+try:
+    from cytoolz import nth
+except ImportError:
+    from toolz import nth
+
 from itertools import islice
 from collections import Iterator
 from multiprocessing.pool import ThreadPool


Test patch:
Repository: blaze/blaze

Issue:
import blaze error -- Blueprint not defined
If I do import blaze, I get the following. This is version 0.8 on python 2.7 on Ubuntu 64-bit.

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/alldata/home/gzhu/virtualenv_support/research/lib/python2.7/site-packages/blaze/__init__.py", line 39, in <module>
    from .server import *
  File "/alldata/home/gzhu/virtualenv_support/research/lib/python2.7/site-packages/blaze/server/__init__.py", line 3, in <module>
    from .server import Server, to_tree, from_tree, api
  File "/alldata/home/gzhu/virtualenv_support/research/lib/python2.7/site-packages/blaze/server/server.py", line 33, in <module>
    api = Blueprint('api', __name__)
NameError: name 'Blueprint' is not defined
```



Discussion:
Thanks for the report. Fix coming up.


Resolving patch:
diff --git a/blaze/server/client.py b/blaze/server/client.py
--- a/blaze/server/client.py
+++ b/blaze/server/client.py
@@ -1,12 +1,8 @@
 from __future__ import absolute_import, division, print_function
 
-try:
-    import flask
-    from flask import json
-    import requests
-except ImportError:
-    pass
-
+import flask
+from flask import json
+import requests
 
 from odo import resource
 from datashape import dshape
diff --git a/blaze/server/index.py b/blaze/server/index.py
--- a/blaze/server/index.py
+++ b/blaze/server/index.py
@@ -4,6 +4,7 @@
 
 __all__ = 'parse_index', 'emit_index'
 
+
 def parse_index(ind, inside=False):
     """ Parse structured index into Pythonic form
 
diff --git a/blaze/server/server.py b/blaze/server/server.py
--- a/blaze/server/server.py
+++ b/blaze/server/server.py
@@ -1,20 +1,21 @@
 from __future__ import absolute_import, division, print_function
 
-try:
-    import flask
-    from flask import Blueprint, Flask, request
-except ImportError:
-    pass
-
-import blaze
 import socket
 import json
+
+import flask
+from flask import Blueprint, Flask, request
+
 from toolz import assoc
+
+from datashape.predicates import iscollection, isscalar
+from odo import odo
+
+import blaze
 from blaze import compute
 from blaze.expr import utils as expr_utils
 from blaze.compute import compute_up
-from datashape.predicates import iscollection, isscalar
-from odo import odo
+
 from ..interactive import InteractiveSymbol, coerce_scalar
 from ..utils import json_dumps
 from ..expr import Expr, symbol


Test patch:
Repository: blaze/blaze

Issue:
dask test failure
it seems `atop` is using an older dask API

```
================================================================================= FAILURES ==================================================================================
____________________________________________________________________________ test_compute[expr0] ____________________________________________________________________________
blaze/compute/tests/test_dask.py:69: in test_compute
    result = compute(expr, dask_ns)
../../../../miniconda/envs/py27/lib/python2.7/site-packages/multipledispatch/dispatcher.py:163: in __call__
    return func(*args, **kwargs)
blaze/compute/core.py:470: in compute
    result = top_then_bottom_then_top_again_etc(expr3, d4, **kwargs)
blaze/compute/core.py:164: in top_then_bottom_then_top_again_etc
    expr2, scope2 = bottom_up_until_type_break(expr, scope, **kwargs)
blaze/compute/core.py:371: in bottom_up_until_type_break
    **kwargs)}
../../../../miniconda/envs/py27/lib/python2.7/site-packages/multipledispatch/dispatcher.py:163: in __call__
    return func(*args, **kwargs)
blaze/compute/dask.py:40: in compute_broadcast
    *concat((dat, tuple(range(ndim(dat))[::-1])) for dat in data))
../../../../code/py/dask/dask/array/core.py:1099: in atop
    numblocks = dict([(a.name, a.numblocks) for a, ind in arginds])
```



Discussion:

Resolving patch:
diff --git a/blaze/compute/dask.py b/blaze/compute/dask.py
--- a/blaze/compute/dask.py
+++ b/blaze/compute/dask.py
@@ -24,7 +24,7 @@ def elemwise_array(expr, *data, **kwargs):
     leaves = expr._inputs
     expr_inds = tuple(range(ndim(expr)))[::-1]
     return atop(curry(compute_it, expr, leaves, **kwargs),
-                next(names), expr_inds,
+                expr_inds,
                 *concat((dat, tuple(range(ndim(dat))[::-1])) for dat in data))
 
 
@@ -36,7 +36,7 @@ def compute_broadcast(expr, *data, **kwargs):
         expr_inds = tuple(range(ndim(expr)))[::-1]
         func = get_numba_ufunc(expr)
         return atop(func,
-                    next(names), expr_inds,
+                    expr_inds,
                     *concat((dat, tuple(range(ndim(dat))[::-1])) for dat in data))
 
     def optimize_array(expr, *data):
@@ -64,13 +64,12 @@ def compute_up(expr, data, **kwargs):
                                                  chunk=chunk)
 
     inds = tuple(range(ndim(leaf)))
-    tmp = atop(curry(compute_it, chunk_expr, [chunk], **kwargs),
-               next(names), inds,
-               data, inds)
+    tmp = atop(curry(compute_it, chunk_expr, [chunk], **kwargs), inds, data,
+               inds)
 
     return atop(compose(curry(compute_it, agg_expr, [agg], **kwargs),
                         curry(_concatenate2, axes=expr.axis)),
-                next(names), tuple(i for i in inds if i not in expr.axis),
+                tuple(i for i in inds if i not in expr.axis),
                 tmp, inds)
 
 


Test patch:
Repository: blaze/blaze

Issue:
psutil.NUM_CPUS deprecated and removed
``` python
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-11-5c5ee3cb747a> in <module>()
----> 1 import blaze

/home/skipper/.virtualenvs/py3/lib/python3.4/site-packages/blaze/__init__.py in <module>()
     16 
     17 from datashape import dshape, discover
---> 18 from .utils import ignoring
     19 from .expr import (Symbol, TableSymbol, symbol, ndim, shape)
     20 from .expr import (by, count, count_values, distinct, head, join, label, like,

/home/skipper/.virtualenvs/py3/lib/python3.4/site-packages/blaze/utils.py in <module>()
     25 from .dispatch import dispatch
     26 
---> 27 thread_pool = ThreadPool(psutil.NUM_CPUS)
     28 
     29 

AttributeError: 'module' object has no attribute 'NUM_CPUS'
```

```
Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
Type "copyright", "credits" or "license" for more information.

IPython 3.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
[TerminalIPythonApp] WARNING | File not found: '/home/skipper/.pystartup'
import pu
[~/]
[1]: import psutil

[~/]
[2]: psutil.__version__
[2]: '3.0.0'
```

https://github.com/giampaolo/psutil/issues/451



Discussion:
thanks for the report, pr on the way


Resolving patch:
diff --git a/blaze/utils.py b/blaze/utils.py
--- a/blaze/utils.py
+++ b/blaze/utils.py
@@ -24,7 +24,7 @@
 
 from .dispatch import dispatch
 
-thread_pool = ThreadPool(psutil.NUM_CPUS)
+thread_pool = ThreadPool(psutil.cpu_count())
 
 
 def nth_list(n, seq):


Test patch:
Repository: blaze/blaze

Issue:
Blaze server yaml file error
Testing the Blaze server from a file and getting the following error:

``` python
$ blaze-server server.yaml
Traceback (most recent call last):
  File "/anaconda/envs/ep-blaze/bin/blaze-server", line 6, in <module>
    sys.exit(_main())
  File "/anaconda/envs/ep-blaze/lib/python2.7/site-packages/blaze/server/spider.py", line 130, in _main
    ignore = tuple(getattr(__builtins__, e) for e in args.ignored_exception)
  File "/anaconda/envs/ep-blaze/lib/python2.7/site-packages/blaze/server/spider.py", line 130, in <genexpr>
    ignore = tuple(getattr(__builtins__, e) for e in args.ignored_exception)
AttributeError: 'dict' object has no attribute 'Exception'
```

I believe problem is in this line:
https://github.com/ContinuumIO/blaze/blob/06991f6d368f23700019e36b337ea2800f37ab14/blaze/server/spider.py#L130
when no ignored_exception in the args is passed.



Discussion:
Sorry for the delay. Thanks for finding this.


Resolving patch:
diff --git a/blaze/server/spider.py b/blaze/server/spider.py
--- a/blaze/server/spider.py
+++ b/blaze/server/spider.py
@@ -13,6 +13,11 @@
 
 from .server import Server, DEFAULT_PORT
 
+try:
+    import __builtin__ as builtins
+except ImportError:
+    import builtins
+
 
 __all__ = 'spider', 'from_yaml'
 
@@ -115,7 +120,7 @@ def _parse_args():
                    help='Host name. Use 0.0.0.0 to listen on all public IPs')
     p.add_argument('-l', '--follow-links', action='store_true',
                    help='Follow links when listing files')
-    p.add_argument('-e', '--ignored-exception', nargs='*',
+    p.add_argument('-e', '--ignored-exception', nargs='+',
                    default=['Exception'],
                    help='Exceptions to ignore when calling resource on a file')
     p.add_argument('-d', '--hidden', action='store_true',
@@ -127,7 +132,7 @@ def _parse_args():
 
 def _main():
     args = _parse_args()
-    ignore = tuple(getattr(__builtins__, e) for e in args.ignored_exception)
+    ignore = tuple(getattr(builtins, e) for e in args.ignored_exception)
     resources = from_yaml(args.path,
                           ignore=ignore,
                           followlinks=args.follow_links,


Test patch:
Repository: blaze/blaze

Issue:
Nan rows for filtered out data using bcolz backend
This quirk was reported in this thread: https://groups.google.com/a/continuum.io/forum/#!topic/blaze-dev/BqJx4LAy0xE

```
In [28]: blaze.__version__
'0.8.0'

In [29]: bcolz.__version__
'0.8.1'
```

The bcolz backend to Blaze seems to display a nan entry for the filtered out rows:

```
In [22]: df = blaze.Data(bcolz.ctable([[1,1,3,3], [1,2,3,4]]))

In [23]: df = df[df['f1']==3]

In [24]: blaze.by(df[['f0']], Sum=df['f1'].sum())

   f0  Sum
0   1  NaN
1   3    3


The Pandas backend behaves as I would expect:

In [25]: df = blaze.Data(pandas.DataFrame(dict(f0=[1,1,3,3], f1=[1,2,3,4])))

In [26]: df = df[df['f1']==3]

In [27]: blaze.by(df[['f0']], Sum=df['f1'].sum())

   f0  Sum
0   3    3
```



Discussion:

Resolving patch:
diff --git a/blaze/compute/pandas.py b/blaze/compute/pandas.py
--- a/blaze/compute/pandas.py
+++ b/blaze/compute/pandas.py
@@ -358,6 +358,8 @@ def compute_by(t, s, g, df):
                                   [compute(v._child, {t._child: df})
                                    for v in one.values])))
 
+    if not df.index.equals(preapply.index):
+        df = df.loc[preapply.index]
     df2 = concat_nodup(df, preapply)
 
     groups = df2.groupby(g)
diff --git a/blaze/expr/optimize.py b/blaze/expr/optimize.py
--- a/blaze/expr/optimize.py
+++ b/blaze/expr/optimize.py
@@ -64,7 +64,7 @@ def _lean(expr, fields=None):
 
 @dispatch(Arithmetic)
 def _lean(expr, fields=None):
-    lhs, right_fields  = _lean(expr.lhs, fields=())
+    lhs, right_fields = _lean(expr.lhs, fields=())
     rhs, left_fields = _lean(expr.rhs, fields=())
     new_fields = set(fields) | set(left_fields) | set(right_fields)
 


Test patch:
diff --git a/blaze/compute/tests/test_bcolz_compute.py b/blaze/compute/tests/test_bcolz_compute.py
--- a/blaze/compute/tests/test_bcolz_compute.py
+++ b/blaze/compute/tests/test_bcolz_compute.py
@@ -7,7 +7,10 @@
 
 import numpy as np
 
+import pandas.util.testing as tm
+
 from odo import into
+from blaze import by
 from blaze.expr import symbol
 from blaze.compute.core import compute, pre_compute
 from blaze.compute.bcolz import get_chunksize
@@ -161,3 +164,13 @@ def test_chunksize_inference():
 def test_notnull():
     with pytest.raises(AttributeError):
         t.b.notnull
+
+
+def test_by_with_single_row():
+    ct = bcolz.ctable([[1, 1, 3, 3], [1, 2, 3, 4]], names=list('ab'))
+    t = symbol('t', discover(ct))
+    subset = t[t.a == 3]
+    expr = by(subset.a, b_sum=subset.b.sum())
+    result = compute(expr, ct)
+    expected = compute(expr, ct, optimize=False)
+    tm.assert_frame_equal(result, expected)
Repository: blaze/blaze

Issue:
Blaze Server rejects valid Content-Types with option information
Firefox <44 sends an additional `charset=` option with the content-type header, even when it's not required (see the [bug](https://bugzilla.mozilla.org/show_bug.cgi?id=918742)) -- this, or any other option, makes the content-type unrecognizable by Blaze server.



Discussion:

Resolving patch:
diff --git a/blaze/server/server.py b/blaze/server/server.py
--- a/blaze/server/server.py
+++ b/blaze/server/server.py
@@ -15,6 +15,7 @@
 import flask
 from flask import Blueprint, Flask, request, Response
 from flask.ext.cors import cross_origin
+from werkzeug.http import parse_options_header
 from toolz import valmap
 
 import blaze
@@ -190,15 +191,15 @@ def authorized(*args, **kwargs):
 def check_request(f):
     @functools.wraps(f)
     def check():
-        content_type = request.headers['content-type']
-        matched = mimetype_regex.match(content_type)
+        raw_content_type = request.headers['content-type']
+        content_type, options = parse_options_header(raw_content_type)
 
-        if matched is None:
+        if content_type not in accepted_mimetypes:
             return ('Unsupported serialization format %s' % content_type,
                     RC.UNSUPPORTED_MEDIA_TYPE)
 
         try:
-            serial = _get_format(matched.groups()[0])
+            serial = _get_format(accepted_mimetypes[content_type])
         except KeyError:
             return ("Unsupported serialization format '%s'" % matched.groups()[0],
                     RC.UNSUPPORTED_MEDIA_TYPE)
@@ -486,8 +487,8 @@ def from_tree(expr, namespace=None):
         return expr
 
 
-mimetype_regex = re.compile(r'^application/vnd\.blaze\+(%s)$' %
-                            '|'.join(x.name for x in all_formats))
+accepted_mimetypes = {'application/vnd.blaze+{}'.format(x.name): x.name for x
+                         in all_formats}
 
 
 @api.route('/compute', methods=['POST', 'HEAD', 'OPTIONS'])


Test patch:
Repository: blaze/blaze

Issue:
Coerce to `'string'` broken with Pandas
``` python
In [1]: import pandas as pd

In [2]: df = pd.Series([1, 2, 3])

In [3]: import blaze as bz

In [4]: bdf = bz.data(df)

In [7]: bz.compute(bdf.coerce('string')).dtypes
Out[7]: dtype('O')

In [8]: res = bz.compute(bdf.coerce('string'))

In [10]: type(res.iloc[0])
Out[10]: int
```



Discussion:
this bug is also in `python.py` because we find dispatch to `dtype.type(value)` which is `np.object_(value)` which is `value`.

For the series/daskseries case we are calling `astype('O')` which gives us an object array of `int` objects. I think we just need to special case `string` here and map `str` over the array instead.

Maybe something like:

``` python
@dispatch(Coerce, (Series, DaskSeries))
def compute_up(expr, data, **kwargs):
    if expr.to == datashape.string:
        return data.map(str)
    return data.astype(to_numpy_dtype(expr.schema))
```


Resolving patch:
diff --git a/blaze/compute/pandas.py b/blaze/compute/pandas.py
--- a/blaze/compute/pandas.py
+++ b/blaze/compute/pandas.py
@@ -753,6 +753,12 @@ def compute_up(expr, data, **kwargs):
 
 @dispatch(Coerce, (Series, DaskSeries))
 def compute_up(expr, data, **kwargs):
+    if datashape.dshape(expr.to) in {datashape.string,
+                                     datashape.Option(datashape.string)}:
+        return data.astype(str)
+    elif datashape.dshape(expr.to) in {datashape.datetime_,
+                                       datashape.Option(datashape.datetime_)}:
+        return data.astype(np.datetime64)
     return data.astype(to_numpy_dtype(expr.schema))
 
 


Test patch:
diff --git a/blaze/compute/tests/test_pandas_compute.py b/blaze/compute/tests/test_pandas_compute.py
--- a/blaze/compute/tests/test_pandas_compute.py
+++ b/blaze/compute/tests/test_pandas_compute.py
@@ -925,6 +925,19 @@ def test_coerce_series():
     assert_series_equal(result, expected)
 
 
+@pytest.mark.parametrize('d, tp, ptp', [(list(range(10)), 'string', str),
+                                        (list(range(10)) + [None], '?string', str),
+                                        (['2010-01-01'], 'datetime', np.datetime64),
+                                        (['2010-01-01', None, ''], '?datetime', np.datetime64)])
+def test_coerce_series_string_datetime(d, tp, ptp):
+    s = pd.Series(d, name='a')
+    e = symbol('t', discover(s)).coerce(to=tp)
+    assert e.schema == dshape(tp)
+    result = compute(e, s)
+    expected = s.astype(ptp)
+    assert_series_equal(result, expected)
+
+
 def test_concat_arr():
     s_data = Series(np.arange(15))
     t_data = Series(np.arange(15, 30))