ColinLeeo commented on code in PR #388: URL: https://github.com/apache/tsfile/pull/388#discussion_r1965942292
########## python/tsfile/tsfile_reader.pyx: ########## @@ -0,0 +1,148 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +#cython: language_level=3 + +from .tsfile_cpp cimport * +from .tsfile_py_cpp cimport * + +from tsfile.schema import TSDataType as TSDataTypePy +from cpython.bytes cimport PyBytes_AsString +from cpython.unicode cimport PyUnicode_AsUTF8String +from typing import List + + +cdef class ResultSetPy: + """ + Get data from a query result. + """ + cdef ResultSet result + cdef ResultSetMetaData metadata_c + cdef public object metadata + cdef public object device_name + + cdef init_c(self, ResultSet result, object device_name): + """ + Init c symbols. + """ + self.result = result + self.metadata_c = tsfile_result_set_get_metadata(self.result) + self.metadata = from_c_result_set_meta_data(self.metadata_c) + self.metadata.set_device_name(device_name) + + def has_next(self): + """ + Check if the query has next rows. + """ + return tsfile_result_set_has_next(self.result) Review Comment: rename it to next() -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
