Skip to content

Commit a167267

Browse files
authored
Merge pull request #24558 from jitseniesen/polars
PR: Support Polars data frames in Variable Explorer
2 parents a5d670a + 645b2b9 commit a167267

File tree

14 files changed

+279
-56
lines changed

14 files changed

+279
-56
lines changed

external-deps/spyder-kernels/.gitrepo

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

external-deps/spyder-kernels/SECURITY.md

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

external-deps/spyder-kernels/requirements/tests.txt

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

external-deps/spyder-kernels/setup.py

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

external-deps/spyder-kernels/spyder_kernels/comms/commbase.py

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

external-deps/spyder-kernels/spyder_kernels/console/kernel.py

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

external-deps/spyder-kernels/spyder_kernels/console/tests/test_console_kernel.py

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

external-deps/spyder-kernels/spyder_kernels/utils/nsview.py

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

external-deps/spyder-kernels/spyder_kernels/utils/tests/test_nsview.py

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spyder/plugins/ipythonconsole/widgets/namespacebrowser.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def get_value(self, name):
5454
reason_comm = _(
5555
"The channel used to communicate with the kernel is not working."
5656
)
57+
reason_missing_package_target = _(
58+
"The '<tt>{}</tt>' module is required to open this variable and "
59+
"it's not installed in the console environment. To fix this "
60+
"problem, please install it in the environment which you use to "
61+
"run your code."
62+
)
5763
reason_missing_package_installer = _(
5864
"The '<tt>{}</tt>' module is required to open this variable. "
5965
"Unfortunately, it's not part of our installer, which means your "
@@ -65,7 +71,7 @@ def get_value(self, name):
6571
"install it in the same environment that you use to run Spyder."
6672
)
6773
reason_mismatched_python = _(
68-
"There is a mistmatch between the Python versions used by Spyder "
74+
"There is a mismatch between the Python versions used by Spyder "
6975
"({}) and the kernel of your current console ({}).<br><br>"
7076
"To fix it, you need to recreate your console environment with "
7177
"Python {} or {}."
@@ -78,6 +84,7 @@ def get_value(self, name):
7884
"<a href='{}'>Github</a>."
7985
).format(GH_ISSUES)
8086

87+
kernel_call_success = False
8188
try:
8289
value = self.call_kernel(
8390
blocking=True,
@@ -88,6 +95,7 @@ def get_value(self, name):
8895
display_error=False,
8996
timeout=CALL_KERNEL_TIMEOUT
9097
).get_value(name, encoded=True)
98+
kernel_call_success = True
9199
value = cloudpickle.loads(value)
92100
return value
93101
except TimeoutError:
@@ -129,12 +137,14 @@ def get_value(self, name):
129137
except CommError:
130138
raise ValueError(msg % reason_comm)
131139
except ModuleNotFoundError as e:
132-
if is_conda_based_app():
133-
raise ValueError(
134-
msg % reason_missing_package_installer.format(e.name)
135-
)
140+
if not kernel_call_success:
141+
name = e.args[0].error.name
142+
reason = reason_missing_package_target.format(name)
143+
elif is_conda_based_app():
144+
reason = reason_missing_package_installer.format(e.name)
136145
else:
137-
raise ValueError(msg % reason_missing_package.format(e.name))
146+
reason = reason_missing_package.format(e.name)
147+
raise ValueError(msg % reason)
138148
except Exception:
139149
raise ValueError(msg % reason_other)
140150

0 commit comments

Comments
 (0)