Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Apr 22, 2024
1 parent b973096 commit f1bbaf9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
23 changes: 19 additions & 4 deletions python/src/nanoarrow/numpy_iterator.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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)
Expand Down
20 changes: 19 additions & 1 deletion python/tests/test_numpy_iterator.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down

0 comments on commit f1bbaf9

Please sign in to comment.