-
Notifications
You must be signed in to change notification settings - Fork 1
feat: port to mojo nightly 20250426 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0822c69
to
934d048
Compare
@@ -29,6 +29,19 @@ struct Buffer(Movable): | |||
self.size = existing.size | |||
self.owns = existing.owns | |||
|
|||
fn swap(mut self, mut other: Self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you cover this method explicitly with a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, added.
@@ -23,7 +23,8 @@ def test_schema_from_pyarrow(): | |||
def test_primitive_array_from_pyarrow(): | |||
var pa = Python.import_module("pyarrow") | |||
var pyarr = pa.array( | |||
[1, 2, 3, 4, 5], mask=[False, False, False, False, True] | |||
PythonObject.list(1, 2, 3, 4, 5), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch, can you point me to the relevant mojo change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure exactly which one is the main commit but these are in the stream:
- modular/modular@91d2851
- modular/modular@bd26407
- Fix in the examples modular/modular@a2ff108
Somewhat related, the string changes: modular/modular@edbbc46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the changelog https://github.com/modular/max/blob/main/mojo/docs/changelog.md#standard-library-changes
PythonObject is no longer implicitly constructible from tuple or list literals, e.g. var x : PythonObject = [1, 2, "foo"] is no longer accepted. Instead, please use named constructors like var x = Python.list(1, 2, "foo"). We hope to re-enable the syntax in the future as the standard library matures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pointers! This is unfortunate but maybe we can restore it later on.
057d0d9
to
2b0488e
Compare
The following changes are affecting us:
grow
, I implemented a swap method since that seems more correct anyway.Let me know what you think.