Skip to content

Commit 634f196

Browse files
committed
refactor: migrate over to pixi from magic
1 parent 7e4b5e1 commit 634f196

File tree

13 files changed

+6928
-1490
lines changed

13 files changed

+6928
-1490
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,11 @@ jobs:
1212
steps:
1313
- name: Checkout repo
1414
uses: actions/checkout@v2
15-
- name: Install magic
16-
run: |
17-
curl -ssL https://magic.modular.com/6b3752cd-debc-45dd-b249-5d4941e1c18c | bash
18-
echo "/home/runner/.modular/bin:$PATH" >> $GITHUB_PATH
19-
15+
- uses: prefix-dev/setup-pixi@v0.8.8
16+
with:
17+
cache: true
18+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
2019
- name: checks
21-
run: |
22-
/home/runner/.modular/bin/magic run fmt
23-
20+
run: pixi run fmt
2421
- name: tests
25-
run: |
26-
/home/runner/.modular/bin/magic run test
27-
22+
run: pixi run test

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,7 @@ cython_debug/
166166
.pixi
167167
# magic environments
168168
.magic
169+
170+
# pixi environments
171+
.pixi
172+
*.egg-info

firebolt/.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

firebolt/README.md

Whitespace-only changes.

firebolt/arrays/base.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ struct ChunkedArray:
6969
self.chunks = chunks
7070
self.length = 0
7171
for chunk in chunks:
72-
self.length += chunk[].length
72+
self.length += chunk.length

firebolt/buffers.mojo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ struct Buffer(Movable):
113113
self.ptr.bitcast[output]()[index] = value
114114

115115

116-
struct Bitmap(Writable):
116+
struct Bitmap(Movable, Writable):
117117
"""Hold information about the null records in an array."""
118118

119119
var buffer: Buffer

firebolt/dtypes.mojo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ alias LARGE_LIST_VIEW = 42
142142

143143

144144
@value
145-
struct Field(CollectionElement, EqualityComparable):
145+
struct Field(Copyable, Movable, EqualityComparable):
146146
var name: String
147147
var dtype: DataType
148148
var nullable: Bool
@@ -165,7 +165,7 @@ struct Field(CollectionElement, EqualityComparable):
165165
return not self == other
166166

167167

168-
struct DataType(CollectionElement, EqualityComparable, Stringable):
168+
struct DataType(Copyable, Movable, EqualityComparable, Stringable):
169169
var code: UInt8
170170
var native: DType
171171
var fields: List[Field]
@@ -346,7 +346,7 @@ fn struct_(*fields: Field) -> DataType:
346346
# but that doesn't seem to be supported
347347
var struct_fields = List[Field](capacity=len(fields))
348348
for field in fields:
349-
struct_fields.append(field[])
349+
struct_fields.append(field)
350350
return DataType(code=STRUCT, fields=struct_fields)
351351

352352

firebolt/schema.mojo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ struct Schema(Movable):
6161
if not name:
6262
raise Error("Either an index or a name must be provided.")
6363
for field in self.fields:
64-
if field[].name.as_string_slice() == name.value():
65-
return field[]
64+
if field.name.as_string_slice() == name.value():
65+
return field
6666
raise Error(
6767
StringSlice("Field with name `{}` not found.").format(name.value())
6868
)

firebolt/tests/test_c_data.mojo

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def test_schema_from_pyarrow():
77
var pa = Python.import_module("pyarrow")
88
var pyint = pa.field("int_field", pa.int32())
99
var pystring = pa.field("string_field", pa.string())
10-
var pyschema = pa.schema(PythonObject.list())
10+
var pyschema = pa.schema(Python.list())
1111
pyschema = pyschema.append(pyint)
1212
pyschema = pyschema.append(pystring)
1313

@@ -23,8 +23,8 @@ def test_schema_from_pyarrow():
2323
def test_primitive_array_from_pyarrow():
2424
var pa = Python.import_module("pyarrow")
2525
var pyarr = pa.array(
26-
PythonObject.list(1, 2, 3, 4, 5),
27-
mask=PythonObject.list(False, False, False, False, True),
26+
Python.list(1, 2, 3, 4, 5),
27+
mask=Python.list(False, False, False, False, True),
2828
)
2929

3030
var c_array = CArrowArray.from_pyarrow(pyarr)
@@ -61,8 +61,8 @@ def test_binary_array_from_pyarrow():
6161
var pa = Python.import_module("pyarrow")
6262

6363
var pyarr = pa.array(
64-
PythonObject.list("foo", "bar", "baz"),
65-
mask=PythonObject.list(False, False, True),
64+
Python.list("foo", "bar", "baz"),
65+
mask=Python.list(False, False, True),
6666
)
6767

6868
var c_array = CArrowArray.from_pyarrow(pyarr)
@@ -97,12 +97,12 @@ def test_binary_array_from_pyarrow():
9797
def test_list_array_from_pyarrow():
9898
var pa = Python.import_module("pyarrow")
9999

100-
var pylist1 = PythonObject.list(1, 2, 3)
101-
var pylist2 = PythonObject.list(4, 5)
102-
var pylist3 = PythonObject.list(6, 7)
100+
var pylist1 = Python.list(1, 2, 3)
101+
var pylist2 = Python.list(4, 5)
102+
var pylist3 = Python.list(6, 7)
103103
var pyarr = pa.array(
104-
PythonObject.list(pylist1, pylist2, pylist3),
105-
mask=PythonObject.list(False, True, False),
104+
Python.list(pylist1, pylist2, pylist3),
105+
mask=Python.list(False, True, False),
106106
)
107107

108108
var c_array = CArrowArray.from_pyarrow(pyarr)

firebolt/tests/test_schema.mojo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ def test_schema_primitive_fields():
5353
def test_from_c_schema() -> None:
5454
var pa = Python.import_module("pyarrow")
5555
var pa_schema = pa.schema(
56-
PythonObject.list(
56+
Python.list(
5757
pa.field("field1", pa.list_(pa.int32())),
5858
pa.field(
5959
"field2",
6060
pa.`struct`(
61-
PythonObject.list(
61+
Python.list(
6262
pa.field("field_a", pa.int32()),
6363
pa.field("field_b", pa.float64()),
6464
)

0 commit comments

Comments
 (0)