From f1bbaf9e899de78682b0b4d65fab1fbcda956f4a Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Mon, 22 Apr 2024 00:21:53 -0300 Subject: [PATCH] format --- python/src/nanoarrow/numpy_iterator.py | 23 +++++++++++++++++++---- python/tests/test_numpy_iterator.py | 20 +++++++++++++++++++- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/python/src/nanoarrow/numpy_iterator.py b/python/src/nanoarrow/numpy_iterator.py index e5dd940e2..6e4471024 100644 --- a/python/src/nanoarrow/numpy_iterator.py +++ b/python/src/nanoarrow/numpy_iterator.py @@ -1,8 +1,24 @@ -import numpy as np +# 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. -from nanoarrow.iterator import PyIterator +import numpy as np from nanoarrow._lib import CArrowType -from nanoarrow.c_lib import c_schema_view, c_array_stream +from nanoarrow.c_lib import c_array_stream, c_schema_view +from nanoarrow.iterator import PyIterator def to_numpy_dtype(schema): @@ -58,7 +74,6 @@ def to_numpy(obj, schema=None, dtype=None): class NumPyIterator(PyIterator): - @classmethod def get_dtype_and_iterator(cls, obj, schema=None, dtype=None): stream = c_array_stream(obj, schema=schema) diff --git a/python/tests/test_numpy_iterator.py b/python/tests/test_numpy_iterator.py index bd4de75bc..b0e431cb1 100644 --- a/python/tests/test_numpy_iterator.py +++ b/python/tests/test_numpy_iterator.py @@ -1,6 +1,24 @@ +# 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. + import numpy as np -import nanoarrow as na from nanoarrow.c_lib import CArrayStream + +import nanoarrow as na from nanoarrow import numpy_iterator