pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

[BUG] dgl type error

Open lmeyerov opened this issue 1 year ago • 0 comments

Maybe datetime handling is having issues?

pygraphistry/docker$ ./test-gpu-local.sh =>

=================================== FAILURES ===================================
_________________ TestDGL.test_build_dgl_with_no_node_features _________________

self = <test_dgl_utils.TestDGL testMethod=test_build_dgl_with_no_node_features>

    @pytest.mark.skipif(not has_dependancy, reason="requires DGL dependencies")
    def test_build_dgl_with_no_node_features(self):
        g = graphistry.edges(edf, src, dst)
        g.reset_caches()  # so that we redo calcs
        #g = g.umap(scale=1) #keep all edges with scale = 100
        # should produce random features for nodes
>       g2 = g.build_gnn(
            use_node_scaler="robust",
            use_edge_scaler="robust",
        )

graphistry/tests/test_dgl_utils.py:172: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
graphistry/dgl_utils.py:493: in build_gnn
    res = res._featurize_edges_to_dgl(
graphistry/dgl_utils.py:376: in _featurize_edges_to_dgl
    X_enc, y_enc, res = res._featurize_or_get_edges_dataframe_if_X_is_None(
graphistry/feature_utils.py:2414: in _featurize_or_get_edges_dataframe_if_X_is_None
    res = res._featurize_edges(
graphistry/feature_utils.py:1973: in _featurize_edges
    encoder.fit(src=res._source, dst=res._destination, **nfkwargs)
graphistry/feature_utils.py:1602: in fit
    res = self._encode(
graphistry/feature_utils.py:1555: in _encode
    res = process_edge_dataframes(
graphistry/feature_utils.py:1296: in process_edge_dataframes
    ) = process_nodes_dataframes(
graphistry/feature_utils.py:1089: in process_nodes_dataframes
    X_enc, y_enc, data_encoder, label_encoder = process_dirty_dataframes(
graphistry/feature_utils.py:875: in process_dirty_dataframes
    X_enc = data_encoder.fit_transform(ndf, y)
../conda/envs/rapids/lib/python3.8/site-packages/dirty_cat/super_vectorizer.py:430: in fit_transform
    return super().fit_transform(X, y)
../conda/envs/rapids/lib/python3.8/site-packages/sklearn/compose/_column_transformer.py:529: in fit_transform
    return self._hstack(list(Xs))
../conda/envs/rapids/lib/python3.8/site-packages/sklearn/compose/_column_transformer.py:588: in _hstack
    converted_Xs = [check_array(X,
../conda/envs/rapids/lib/python3.8/site-packages/sklearn/compose/_column_transformer.py:588: in <listcomp>
    converted_Xs = [check_array(X,
../conda/envs/rapids/lib/python3.8/site-packages/sklearn/utils/validation.py:63: in inner_f
    return f(*args, **kwargs)
../conda/envs/rapids/lib/python3.8/site-packages/sklearn/utils/validation.py:597: in check_array
    dtype_orig = np.result_type(*dtypes_orig)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (dtype('int64'), dtype('<M8[ns]'), dtype('float64'), dtype('float64'), dtype('float64'), dtype('float64'), ...)
kwargs = {}
relevant_args = (dtype('int64'), dtype('<M8[ns]'), dtype('float64'), dtype('float64'), dtype('float64'), dtype('float64'), ...)

>   ???
E   TypeError: The DType <class 'numpy.dtype[datetime64]'> could not be promoted by <class 'numpy.dtype[float64]'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is `object`. The full list of DTypes is: (<class 'numpy.dtype[int64]'>, <class 'numpy.dtype[datetime64]'>, <class 'numpy.dtype[float64]'>, <class 'numpy.dtype[float64]'>, <class 'numpy.dtype[float64]'>, <class 'numpy.dtype[float64]'>, <class 'numpy.dtype[int64]'>, <class 'numpy.dtype[int64]'>, <class 'numpy.dtype[int64]'>)

lmeyerov avatar Jul 26 '22 04:07 lmeyerov