marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Autocomplete does not find suggestions in polars namespaces

Open kjgoodrick opened this issue 1 year ago • 3 comments

Describe the bug

When using polars the marimo autocomplete is unable to find any suggestions for names that are within namespaces. For example, here is what the autocomplete shows for the dt namespace.

Image

Here is what VS Code shows: Image

Environment

{ "marimo": "0.10.7", "OS": "Darwin", "OS Version": "24.2.0", "Processor": "arm", "Python Version": "3.13.1", "Binaries": { "Browser": "--", "Node": "v23.5.0" }, "Dependencies": { "click": "8.1.3", "docutils": "0.21.2", "itsdangerous": "2.2.0", "jedi": "0.19.2", "markdown": "3.7", "narwhals": "1.19.1", "packaging": "24.2", "psutil": "6.1.1", "pygments": "2.18.0", "pymdown-extensions": "10.13", "pyyaml": "6.0.2", "ruff": "0.6.9", "starlette": "0.42.0", "tomlkit": "0.13.2", "typing-extensions": "4.12.2", "uvicorn": "0.34.0", "websockets": "14.1" }, "Optional Dependencies": { "altair": "5.5.0", "duckdb": "1.1.3", "pandas": "2.2.3", "polars": "1.17.1", "pyarrow": "18.1.0" } }

Code to reproduce

import polars as pl

pl.col("col_name").dt

kjgoodrick avatar Dec 27 '24 21:12 kjgoodrick

Thanks for reporting!

I did some digging. I've opened an issue in the Polars repository, as they've been helpful in resolving similar issues in the past: https://github.com/pola-rs/polars/issues/20496

IPython has the same issue:

Image

As does jedi (which marimo uses for completion).

Image

akshayka avatar Dec 29 '24 19:12 akshayka

The issue I created is a duplicate of https://github.com/pola-rs/polars/issues/16933. I consider this blocked on upstream (Polars), short of us switching to a different technology to power completions.

akshayka avatar Dec 30 '24 18:12 akshayka

Have you considered using PyRight to do autocompletions? Using that at least this example ends autocompleting correctly

MarcoGorelli avatar Jan 03 '25 10:01 MarcoGorelli

Good news; can confirm this upcoming fix addresses both IPython and Marimo... 😎 https://github.com/pola-rs/polars/pull/22221

alexander-beedie avatar Apr 11 '25 07:04 alexander-beedie

Awesome, thanks @alexander-beedie! Closing this on our end

mscolnick avatar Apr 11 '25 16:04 mscolnick