Skip to content

Commit b741eb5

Browse files
authored
Update to the latest Microsoft.DotNet.Interactive (dotnet#5710)
* Update to the latest Microsoft.DotNet.Interactive * Add System.CommandLine nuget feed * Fix Data.Analysis.Interactive test
1 parent b916d37 commit b741eb5

File tree

8 files changed

+295
-287
lines changed

8 files changed

+295
-287
lines changed

Diff for: .editorconfig

+5
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ dotnet_diagnostic.MSML_ExtendBaseTestClass.severity = none
2626
# The MSML_RelaxTestNaming suppressor for VSTHRD200 is not active for CodeAnalyzer.Tests, so we disable it altogether.
2727
# VSTHRD200: Use "Async" suffix for async methods
2828
dotnet_diagnostic.VSTHRD200.severity = none
29+
30+
# Xml project files
31+
[*.{csproj}]
32+
indent_size = 2
33+
charset = utf-8

Diff for: NuGet.config

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<clear />
88
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
99
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
10+
<add key="dotnet-libraries" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-libraries/nuget/v3/index.json" />
1011
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
1112
<add key="vs-buildservices" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
1213
<add key="dotnet5-roslyn" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />

Diff for: eng/Versions.props

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
<TensorFlowMajorVersion>2</TensorFlowMajorVersion>
3434
<TensorflowDotNETVersion>0.20.1</TensorflowDotNETVersion>
3535
<MicrosoftCodeAnalysisCSharpInternalAnalyzerVersion>3.3.1</MicrosoftCodeAnalysisCSharpInternalAnalyzerVersion>
36-
<MicrosoftDotNetInteractiveVersion>1.0.0-beta.20410.1</MicrosoftDotNetInteractiveVersion>
37-
<MicrosoftDotNetInteractiveFormattingVersion>1.0.0-beta.20410.1</MicrosoftDotNetInteractiveFormattingVersion>
36+
<MicrosoftDotNetInteractiveVersion>1.0.0-beta.21155.3</MicrosoftDotNetInteractiveVersion>
37+
<MicrosoftDotNetInteractiveFormattingVersion>1.0.0-beta.21155.3</MicrosoftDotNetInteractiveFormattingVersion>
3838
<ApacheArrowVersion>2.0.0</ApacheArrowVersion>
3939
<SystemTextEncodingVersion>4.3.0</SystemTextEncodingVersion>
4040
<MicrosoftCSharpVersion>4.5.0</MicrosoftCSharpVersion>

Diff for: src/Microsoft.Data.Analysis.Interactive/DataFrameKernelExtension.cs

+15-15
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ public Task OnLoadAsync(Kernel kernel)
2424

2525
public static void RegisterDataFrame()
2626
{
27-
Formatter<DataFrame>.Register((df, writer) =>
27+
Formatter.Register<DataFrame>((df, writer) =>
2828
{
29-
const int MAX = 10000;
30-
const int SIZE = 10;
29+
const int maxRowCount = 10000;
30+
const int rowsPerPage = 25;
3131

3232
var uniqueId = DateTime.Now.Ticks;
3333

@@ -37,15 +37,15 @@ public static void RegisterDataFrame()
3737
};
3838
header.AddRange(df.Columns.Select(c => (IHtmlContent)th(c.Name)));
3939

40-
if (df.Rows.Count > SIZE)
40+
if (df.Rows.Count > rowsPerPage)
4141
{
42-
var maxMessage = df.Rows.Count > MAX ? $" (showing a max of {MAX} rows)" : string.Empty;
42+
var maxMessage = df.Rows.Count > maxRowCount ? $" (showing a max of {maxRowCount} rows)" : string.Empty;
4343
var title = h3[style: "text-align: center;"]($"DataFrame - {df.Rows.Count} rows {maxMessage}");
4444

4545
// table body
46-
var maxRows = Math.Min(MAX, df.Rows.Count);
46+
var rowCount = Math.Min(maxRowCount, df.Rows.Count);
4747
var rows = new List<List<IHtmlContent>>();
48-
for (var index = 0; index < maxRows; index++)
48+
for (var index = 0; index < rowCount; index++)
4949
{
5050
var cells = new List<IHtmlContent>
5151
{
@@ -58,29 +58,29 @@ public static void RegisterDataFrame()
5858
rows.Add(cells);
5959
}
6060

61-
//navigator
61+
//navigator
6262
var footer = new List<IHtmlContent>();
6363
BuildHideRowsScript(uniqueId);
6464

65-
var paginateScriptFirst = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, 0) + BuildPageScript(uniqueId, SIZE);
65+
var paginateScriptFirst = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, 0) + BuildPageScript(uniqueId, rowsPerPage);
6666
footer.Add(button[style: "margin: 2px;", onclick: paginateScriptFirst]("⏮"));
6767

68-
var paginateScriptPrevTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -10, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE);
68+
var paginateScriptPrevTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -10, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage);
6969
footer.Add(button[style: "margin: 2px;", onclick: paginateScriptPrevTen]("⏪"));
7070

71-
var paginateScriptPrev = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -1, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE);
71+
var paginateScriptPrev = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, -1, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage);
7272
footer.Add(button[style: "margin: 2px;", onclick: paginateScriptPrev]("◀️"));
7373

7474
footer.Add(b[style: "margin: 2px;"]("Page"));
7575
footer.Add(b[id: $"page_{uniqueId}", style: "margin: 2px;"]("1"));
7676

77-
var paginateScriptNext = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 1, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE);
77+
var paginateScriptNext = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 1, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage);
7878
footer.Add(button[style: "margin: 2px;", onclick: paginateScriptNext]("▶️"));
7979

80-
var paginateScriptNextTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 10, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE);
80+
var paginateScriptNextTen = BuildHideRowsScript(uniqueId) + UpdatePageIndex(uniqueId, 10, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage);
8181
footer.Add(button[style: "margin: 2px;", onclick: paginateScriptNextTen]("⏩"));
8282

83-
var paginateScriptLast = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, (maxRows - 1) / SIZE) + BuildPageScript(uniqueId, SIZE);
83+
var paginateScriptLast = BuildHideRowsScript(uniqueId) + GotoPageIndex(uniqueId, (rowCount - 1) / rowsPerPage) + BuildPageScript(uniqueId, rowsPerPage);
8484
footer.Add(button[style: "margin: 2px;", onclick: paginateScriptLast]("⏭️"));
8585

8686
//table
@@ -93,7 +93,7 @@ public static void RegisterDataFrame()
9393
writer.Write(t);
9494

9595
//show first page
96-
writer.Write($"<script>{BuildPageScript(uniqueId, SIZE)}</script>");
96+
writer.Write($"<script>{BuildPageScript(uniqueId, rowsPerPage)}</script>");
9797
}
9898
else
9999
{
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
<IsPackable>false</IsPackable>
6-
<NoWarn>$(NoWarn);MSML_ParameterLocalVarName;SA1028</NoWarn>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<IsPackable>false</IsPackable>
6+
</PropertyGroup>
87

9-
<ItemGroup>
10-
<PackageReference Include="Microsoft.DotNet.Interactive" Version="$(MicrosoftDotNetInteractiveVersion)" />
11-
<PackageReference Include="Microsoft.DotNet.Interactive.Formatting" Version="$(MicrosoftDotNetInteractiveFormattingVersion)" />
12-
</ItemGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.DotNet.Interactive" Version="$(MicrosoftDotNetInteractiveVersion)" />
10+
<PackageReference Include="Microsoft.DotNet.Interactive.Formatting" Version="$(MicrosoftDotNetInteractiveFormattingVersion)" />
11+
</ItemGroup>
1312

14-
<ItemGroup>
15-
<ProjectReference Include="..\Microsoft.Data.Analysis\Microsoft.Data.Analysis.csproj" />
16-
</ItemGroup>
13+
<ItemGroup>
14+
<ProjectReference Include="..\Microsoft.Data.Analysis\Microsoft.Data.Analysis.csproj" />
15+
</ItemGroup>
1716

1817
</Project>

0 commit comments

Comments
 (0)