Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Can not export an empty SFrame #804

Closed
TobyRoseman opened this issue Jul 2, 2018 · 1 comment · Fixed by #2602
Closed

Can not export an empty SFrame #804

TobyRoseman opened this issue Jul 2, 2018 · 1 comment · Fixed by #2602

Comments

@TobyRoseman
Copy link
Collaborator

In [1]: import turicreate as tc

In [2]: tc.SFrame().export_json('/tmp/test.json')
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-2-2449955b3c97> in <module>()
----> 1 tc.SFrame().export_json('/tmp/test.json')

/Users/tobyroseman/Documents/turicreate/debug/src/unity/python/turicreate/data_structures/sframe.pyc in export_json(self, filename, orient)
   2940         """
   2941         if orient == "records":
-> 2942             self.pack_columns(dtype=dict).export_csv(
   2943                     filename, file_header='[', file_footer=']',
   2944                     header=False, double_quote=False,

/Users/tobyroseman/Documents/turicreate/debug/src/unity/python/turicreate/data_structures/sframe.pyc in pack_columns(self, column_names, column_name_prefix, dtype, fill_na, remove_prefix, new_column_name)
   4720         with cython_context():
   4721             ret_sa = SArray(_proxy=self.__proxy__.pack_columns(column_names, dict_keys,
-> 4722                                                                dtype, fill_na))
   4723 
   4724         new_sf = self.select_columns(rest_columns)

/Users/tobyroseman/Documents/turicreate/debug/src/unity/python/turicreate/cython/cy_sframe.pyx in turicreate.cython.cy_sframe.UnitySFrameProxy.pack_columns (/Users/tobyroseman/Documents/turicreate/debug/src/unity/python/turicreate/cython/cy_sframe.cxx:10843)()
    298         return create_proxy_wrapper_from_existing_proxy(proxy)
    299 
--> 300     cpdef pack_columns(self, _column_names, _key_names, dtype, fill_na):
    301         cdef vector[string] column_names = to_vector_of_strings(_column_names)
    302         cdef vector[string] key_names = to_vector_of_strings(_key_names)

/Users/tobyroseman/Documents/turicreate/debug/src/unity/python/turicreate/cython/cy_sframe.pyx in turicreate.cython.cy_sframe.UnitySFrameProxy.pack_columns (/Users/tobyroseman/Documents/turicreate/debug/src/unity/python/turicreate/cython/cy_sframe.cxx:10695)()
    305         cdef flexible_type na_val = flexible_type_from_pyobject(fill_na)
    306         with nogil:
--> 307             proxy = self.thisptr.pack_columns(column_names, key_names, fl_type, na_val)
    308         return sarray_proxy(proxy)
    309 

RuntimeError: There is no column to pack
@dhivyaaxim
Copy link
Contributor

@TobyRoseman @znation Please assign this ticket to me as I would like to try fixing it and contribute .Thanks in advance!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants