@@ -689,6 +689,7 @@ cpdef tuple chunked_read_json(
689689 JsonReaderOptions options,
690690 int chunk_size = 100 _000_000,
691691 Stream stream = None ,
692+ DeviceMemoryResource mr = None ,
692693):
693694 """
694695 Reads chunks of a JSON file into a :py:class:`~.types.TableWithMetadata`.
@@ -718,14 +719,15 @@ cpdef tuple chunked_read_json(
718719 child_names = None
719720 i = 0
720721 cdef Stream s = _get_stream(stream)
722+ mr = _get_memory_resource(mr)
721723 while True :
722724 options.enable_lines(True )
723725 options.set_byte_range_offset(c_range_size * i)
724726 options.set_byte_range_size(c_range_size)
725727
726728 try :
727729 with nogil:
728- c_result = move(cpp_read_json(options.c_obj, s.view()))
730+ c_result = move(cpp_read_json(options.c_obj, s.view(), mr.get_mr() ))
729731 except (ValueError , OverflowError ):
730732 break
731733 if meta_names is None :
@@ -754,7 +756,8 @@ cpdef tuple chunked_read_json(
754756
755757cpdef TableWithMetadata read_json(
756758 JsonReaderOptions options,
757- Stream stream = None
759+ Stream stream = None ,
760+ DeviceMemoryResource mr = None
758761):
759762 """
760763 Read from JSON format.
@@ -778,8 +781,9 @@ cpdef TableWithMetadata read_json(
778781 """
779782 cdef table_with_metadata c_result
780783 cdef Stream s = _get_stream(stream)
784+ mr = _get_memory_resource(mr)
781785 with nogil:
782- c_result = move(cpp_read_json(options.c_obj, s.view()))
786+ c_result = move(cpp_read_json(options.c_obj, s.view(), mr.get_mr() ))
783787
784788 return TableWithMetadata.from_libcudf(c_result, s)
785789
0 commit comments