Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 2019.8.0-rc (30 July 2019)
## 2019.8.0 (6 August 2019)

### Enhancements

Expand Down Expand Up @@ -40,6 +40,8 @@
1. Remove "Debug cell" action from data science code lenses for markdown cells.
(thanks [Janosh Riebesell](https://github.com/janosh))
([#6588](https://github.com/Microsoft/vscode-python/issues/6588))
1. Add debug command code lenses when in debug mode
([#6672](https://github.com/Microsoft/vscode-python/issues/6672))

### Fixes

Expand Down Expand Up @@ -123,6 +125,12 @@
([#6743](https://github.com/Microsoft/vscode-python/issues/6743))
1. Remove Debug Cell and Run Cell from the command palette. They should both be 'Debug Current Cell' and 'Run Current Cell'
([#6754](https://github.com/Microsoft/vscode-python/issues/6754))
1. Make the dataviewer open a window much faster. Total load time is the same, but initial response is much faster.
([#6729](https://github.com/Microsoft/vscode-python/issues/6729))
1. Debugging an untitled file causes an error 'Untitled-1 cannot be opened'.
([#6738](https://github.com/Microsoft/vscode-python/issues/6738))
1. Eliminate 'History_\<guid\>' from the problems list when using the interactive panel.
([#6748](https://github.com/Microsoft/vscode-python/issues/6748))

### Code Health

Expand Down
4 changes: 2 additions & 2 deletions ThirdPartyNotices-Distribution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Microsoft Python extension for Visual Studio Code incorporates third party mater
217. line-by-line 0.1.6 (https://registry.npmjs.org/line-by-line/-/line-by-line-0.1.6.tgz)
218. linear-layout-vector 0.0.1 (https://registry.npmjs.org/linear-layout-vector/-/linear-layout-vector-0.0.1.tgz)
219. linebreak 0.3.0 (https://registry.npmjs.org/linebreak/-/linebreak-0.3.0.tgz)
220. lodash 4.17.13 (https://registry.npmjs.org/lodash/-/lodash-4.17.13.tgz)
220. lodash 4.17.15 (https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz)
221. lodash.clonedeep 4.5.0 (https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz)
222. lodash.curry 4.1.1 (https://registry.npmjs.org/lodash.curry/-/lodash.curry-4.1.1.tgz)
223. lodash.flatten 4.4.0 (https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz)
Expand Down Expand Up @@ -6940,7 +6940,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF linebreak NOTICES AND INFORMATION

%% lodash 4.17.13 NOTICES AND INFORMATION BEGIN HERE (https://registry.npmjs.org/lodash/-/lodash-4.17.13.tgz)
%% lodash 4.17.15 NOTICES AND INFORMATION BEGIN HERE (https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz)
=========================================
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>

Expand Down
1 change: 0 additions & 1 deletion news/2 Fixes/6738.md

This file was deleted.

1 change: 0 additions & 1 deletion news/2 Fixes/6748.md

This file was deleted.

6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2456,7 +2456,7 @@
"@msrvida/python-program-analysis": "0.0.5",
"ansi-regex": "^4.1.0",
"arch": "^2.1.0",
"azure-storage": "^2.10.1",
"azure-storage": "^2.10.3",
"diff-match-patch": "^1.0.0",
"fs-extra": "^4.0.3",
"fuzzy": "^0.1.3",
Expand All @@ -2469,7 +2469,7 @@
"jsonc-parser": "^2.0.3",
"less-plugin-inline-urls": "^1.2.0",
"line-by-line": "^0.1.6",
"lodash": "^4.17.13",
"lodash": "^4.17.15",
"md5": "^2.2.1",
"minimatch": "^3.0.4",
"monaco-editor-textmate": "^2.1.1",
Expand Down
53 changes: 42 additions & 11 deletions src/client/datascience/data-viewing/dataViewerProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import * as localize from '../../common/utils/localize';
import { noop } from '../../common/utils/misc';
import { IInterpreterService } from '../../interpreter/contracts';
import { IServiceContainer } from '../../ioc/types';
import { sendTelemetryEvent } from '../../telemetry';
import { Telemetry } from '../constants';
import { IDataViewer, IDataViewerProvider, IJupyterVariables } from '../types';

@injectable()
Expand All @@ -32,20 +34,35 @@ export class DataViewerProvider implements IDataViewerProvider, IAsyncDisposable
}

public async create(variable: string): Promise<IDataViewer> {
// Make sure this is a valid variable
const variables = await this.variables.getVariables();
const index = variables.findIndex(v => v && v.name === variable);
if (index >= 0) {
const dataExplorer = this.serviceContainer.get<IDataViewer>(IDataViewer);
this.activeExplorers.push(dataExplorer);
await dataExplorer.showVariable(variables[index]);
return dataExplorer;
}
let result: IDataViewer | undefined;

// Create the data explorer (this should show the window)
const dataExplorer = this.serviceContainer.get<IDataViewer>(IDataViewer);
try {
// Verify this is allowed.
await this.checkPandas();

throw new Error(localize.DataScience.dataExplorerInvalidVariableFormat().format(variable));
// Make sure this is a valid variable
const variables = await this.variables.getVariables();
const index = variables.findIndex(v => v && v.name === variable);
if (index >= 0) {
// Then load the data.
this.activeExplorers.push(dataExplorer);
await dataExplorer.showVariable(variables[index]);
result = dataExplorer;
} else {
throw new Error(localize.DataScience.dataExplorerInvalidVariableFormat().format(variable));
}
} finally {
if (!result) {
// If throw any errors, close the window we opened.
dataExplorer.dispose();
}
}
return result;
}

public async getPandasVersion(): Promise<{ major: number; minor: number; build: number } | undefined> {
private async getPandasVersion(): Promise<{ major: number; minor: number; build: number } | undefined> {
const interpreter = await this.interpreterService.getActiveInterpreter();
const launcher = await this.pythonFactory.createActivatedEnvironment({ resource: undefined, interpreter, allowEnvironmentFetchExceptions: true });
try {
Expand All @@ -61,4 +78,18 @@ export class DataViewerProvider implements IDataViewerProvider, IAsyncDisposable
noop();
}
}

private async checkPandas(): Promise<void> {
const pandasVersion = await this.getPandasVersion();
if (!pandasVersion) {
sendTelemetryEvent(Telemetry.PandasNotInstalled);
// Warn user that there is no pandas.
throw new Error(localize.DataScience.pandasRequiredForViewing());
} else if (pandasVersion.major < 1 && pandasVersion.minor < 20) {
sendTelemetryEvent(Telemetry.PandasTooOld);
// Warn user that we cannot start because pandas is too old.
const versionStr = `${pandasVersion.major}.${pandasVersion.minor}.${pandasVersion.build}`;
throw new Error(localize.DataScience.pandasTooOldForViewingFormat().format(versionStr));
}
}
}
19 changes: 1 addition & 18 deletions src/client/datascience/interactive-window/interactiveWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,23 +570,6 @@ export class InteractiveWindow extends WebViewHost<IInteractiveWindowMapping> im
this.addMessageImpl(message, 'preview');
}

private async checkPandas(): Promise<boolean> {
const pandasVersion = await this.dataExplorerProvider.getPandasVersion();
if (!pandasVersion) {
sendTelemetryEvent(Telemetry.PandasNotInstalled);
// Warn user that there is no pandas.
this.applicationShell.showErrorMessage(localize.DataScience.pandasRequiredForViewing());
return false;
} else if (pandasVersion.major < 1 && pandasVersion.minor < 20) {
sendTelemetryEvent(Telemetry.PandasTooOld);
// Warn user that we cannot start because pandas is too old.
const versionStr = `${pandasVersion.major}.${pandasVersion.minor}.${pandasVersion.build}`;
this.applicationShell.showErrorMessage(localize.DataScience.pandasTooOldForViewingFormat().format(versionStr));
return false;
}
return true;
}

private shouldAskForLargeData(): boolean {
const settings = this.configuration.getSettings();
return settings && settings.datascience && settings.datascience.askForLargeDataFrames === true;
Expand Down Expand Up @@ -618,7 +601,7 @@ export class InteractiveWindow extends WebViewHost<IInteractiveWindowMapping> im

private async showDataViewer(request: IShowDataViewer): Promise<void> {
try {
if (await this.checkPandas() && await this.checkColumnSize(request.columnSize)) {
if (await this.checkColumnSize(request.columnSize)) {
await this.dataExplorerProvider.create(request.variableName);
}
} catch (e) {
Expand Down
1 change: 0 additions & 1 deletion src/client/datascience/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ export interface IJupyterVariablesResponse {
export const IDataViewerProvider = Symbol('IDataViewerProvider');
export interface IDataViewerProvider {
create(variable: string): Promise<IDataViewer>;
getPandasVersion(): Promise<{ major: number; minor: number; build: number } | undefined>;
}
export const IDataViewer = Symbol('IDataViewer');

Expand Down