Skip to content

Commit df65c76

Browse files
committed
fix build error
1 parent 194ee9c commit df65c76

5 files changed

+40
-36
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
eStatGoJpConnector/obj/
2+
eStatGoJpConnector/bin/
3+
.vs/eStatGoJpConnector/v15/.suo

eStatGoJpConnector.sln

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.28307.489
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{4DF76451-A46A-4C0B-BE03-459FAAFA07E6}") = "eStatGoJpConnector", "eStatGoJpConnector\eStatGoJpConnector.mproj", "{BD434BDD-C1BB-4720-BD84-91F9F0A5C3B5}"
6+
Project("{4DF76451-A46A-4C0B-BE03-459FAAFA07E6}") = "eStatGoJpConnector", "eStatGoJpConnector\eStatGoJpConnector.mproj", "{44545978-F734-4975-9FC2-643D63C69A26}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|x86 = Debug|x86
1111
Release|x86 = Release|x86
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{BD434BDD-C1BB-4720-BD84-91F9F0A5C3B5}.Debug|x86.ActiveCfg = Debug|x86
15-
{BD434BDD-C1BB-4720-BD84-91F9F0A5C3B5}.Debug|x86.Build.0 = Debug|x86
16-
{BD434BDD-C1BB-4720-BD84-91F9F0A5C3B5}.Release|x86.ActiveCfg = Release|x86
17-
{BD434BDD-C1BB-4720-BD84-91F9F0A5C3B5}.Release|x86.Build.0 = Release|x86
14+
{44545978-F734-4975-9FC2-643D63C69A26}.Debug|x86.ActiveCfg = Debug|x86
15+
{44545978-F734-4975-9FC2-643D63C69A26}.Debug|x86.Build.0 = Debug|x86
16+
{44545978-F734-4975-9FC2-643D63C69A26}.Release|x86.ActiveCfg = Release|x86
17+
{44545978-F734-4975-9FC2-643D63C69A26}.Release|x86.Build.0 = Release|x86
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE

eStatGoJpConnector/eStatGoJpConnector.mproj

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
<AsAction>False</AsAction>
1313
<FastCombine>False</FastCombine>
1414
<ClearLog>False</ClearLog>
15-
<ShowEngineTraces>False</ShowEngineTraces>
16-
<ShowUserTraces>False</ShowUserTraces>
15+
<ShowEngineTraces>True</ShowEngineTraces>
16+
<ShowUserTraces>True</ShowUserTraces>
1717
<LegacyRedirects>False</LegacyRedirects>
1818
<SuppressRowErrors>False</SuppressRowErrors>
1919
<SuppressCellErrors>False</SuppressCellErrors>
2020
<MaxRows>1000</MaxRows>
2121
<ExtensionProject>Yes</ExtensionProject>
2222
<Name>eStatGoJpConnector</Name>
23+
<ThrowOnFoldingFailure>True</ThrowOnFoldingFailure>
2324
</PropertyGroup>
2425
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
2526
<DebugSymbols>false</DebugSymbols>
@@ -64,16 +65,13 @@
6465
<Compile Include="eStatGoJpConnector80.png">
6566
<SubType>Code</SubType>
6667
</Compile>
67-
<Compile Include="resources.en.resx">
68+
<Compile Include="resources.resx">
6869
<SubType>Code</SubType>
6970
</Compile>
7071
<Content Include="eStatGoJpConnector.query.pq">
7172
<SubType>Code</SubType>
7273
</Content>
7374
</ItemGroup>
74-
<ItemGroup>
75-
<EmbeddedResource Include="resources.resx" />
76-
</ItemGroup>
7775
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
7876
<UsingTask TaskName="BuildExtension" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
7977
<ParameterGroup>

eStatGoJpConnector/eStatGoJpConnector.pq

+27-24
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
1-
section eStatGoJpConnector;
1+
// This file contains your Data Connector logic
2+
section eStatGoJpConnector;
23

34
[DataSource.Kind="eStatGoJpConnector", Publish="eStatGoJpConnector.Publish"]
4-
shared eStatGoJpConnector.Nav = Value.ReplaceType(eStatGoJpConnectorNavImpl, eStatGoJpConnectorNavType);
5+
shared eStatGoJpConnector.Contents = Value.ReplaceType(eStatGoJpConnectorImpl, eStatGoJpConnectorType);
56

6-
eStatGoJpConnectorNavType = type function (
7-
searchKind as (type text meta [
8-
Documentation.FieldCaption = Extension.LoadString("Type.searchKind.Documentation.FieldCaption"),
9-
Documentation.FieldDescription = Extension.LoadString("Type.searchKind.Documentation.FieldDescription"),
10-
Documentation.AllowedValues = { "1: 統計情報", "2: 小地域・地域メッシュ", "3: 社会・人口統計体系(都道府県・市区町村のすがた)"}
11-
]),
12-
optional lang as (type text meta [
13-
Documentation.FieldCaption = Extension.LoadString("Type.lang.Documentation.FieldCaption"),
14-
Documentation.FieldDescription = Extension.LoadString("Type.lang.Documentation.FieldDescription"),
15-
Documentation.AllowedValues = { "J: 日本語 (Japanese)", "E: 英語 (English)" }
16-
]))
17-
as table meta [
18-
Documentation.Name = Extension.LoadString("Type.table.Documentation.Name"),
19-
Documentation.LongDescription = Extension.LoadString("Type.table.Documentation.LongDescription"),
20-
Documentation.Examples = {}
21-
];
227

23-
eStatGoJpConnectorNavImpl = (searchKind as text, optional lang as text) as table =>
8+
eStatGoJpConnectorImpl = (optional searchKind as text, optional lang as text)=>
249
let
2510
credentials = Extension.CurrentCredential(),
2611
apiKey = credentials[Password],
2712
_lang = if (lang <> null) then Text.At(lang, 0) else "J",
28-
_url = "https://api.e-stat.go.jp/rest/2.1/app/json/getStatsList?appId=" & apiKey & "&statsNameList=Y&searchKind=" & Text.At(searchKind, 0),
13+
_searchKind = if (searchKind <> null) then searchKind else Text.From("1: 統計情報"),
14+
_url = "https://api.e-stat.go.jp/rest/2.1/app/json/getStatsList?appId=" & apiKey & "&statsNameList=Y&searchKind=" & Text.At(_searchKind, 0),
2915
_response = Web.Contents(_url, [Timeout = #duration(0,0,0,2000), Headers=[#"Authorization" = ""]]),
3016
objects1 = Json.Document(_response),
3117
objects2 = Table.FromRecords(objects1[GET_STATS_LIST][DATALIST_INF][LIST_INF]),
@@ -34,15 +20,31 @@ eStatGoJpConnectorNavImpl = (searchKind as text, optional lang as text) as table
3420
objects5 = Table.AddColumn(objects4, "Name", each [STATNAME_] & " - " & [GOVORG_] & " (" & [STATID_] & ")"),
3521
objects6 = Table.AddColumn(objects5, "Key", each [STATID_]),
3622
objects7 = Table.AddColumn(objects6, "ItemKind", each "Folder"),
37-
objects8 = Table.AddColumn(objects7, "Data", each CreateNavTableLevel1(Extension.CurrentCredential(), [STATID_], _lang)),
23+
objects8 = Table.AddColumn(objects7, "Data", each CreateNavTableLevel1(credentials, [STATID_], _lang)),
3824
objects9 = Table.AddColumn(objects8, "ItemName", each "Folder"),
3925
objects10 = Table.AddColumn(objects9, "IsLeaf", each false),
40-
objects11 = Table.RemoveColumns(objects10, {"@id", "STATID_", "STATNAME_", "GOVORG_", "STATISTICS_NAME_SPEC", "TITLE_SPEC"}),
26+
objects11 = Table.SelectColumns(objects10, {"Name", "Key", "Data", "ItemKind", "ItemName", "IsLeaf"}),
4127
NavTable = Table.ToNavigationTable(objects11, {"Key"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
4228
in
4329
NavTable;
4430

4531

32+
eStatGoJpConnectorType = type function (
33+
optional searchKind as (type text meta [
34+
Documentation.FieldCaption = Extension.LoadString("Type.searchKind.Documentation.FieldCaption"),
35+
Documentation.FieldDescription = Extension.LoadString("Type.searchKind.Documentation.FieldDescription"),
36+
Documentation.AllowedValues = { "1: 統計情報", "2: 小地域・地域メッシュ", "3: 社会・人口統計体系(都道府県・市区町村のすがた)"}
37+
]),
38+
optional lang as (type text meta [
39+
Documentation.FieldCaption = Extension.LoadString("Type.lang.Documentation.FieldCaption"),
40+
Documentation.FieldDescription = Extension.LoadString("Type.lang.Documentation.FieldDescription"),
41+
Documentation.AllowedValues = { "J: 日本語 (Japanese)", "E: 英語 (English)" }
42+
]))
43+
as table meta [
44+
Documentation.Name = Extension.LoadString("Type.table.Documentation.Name"),
45+
Documentation.LongDescription = Extension.LoadString("Type.table.Documentation.LongDescription"),
46+
Documentation.Examples = {}
47+
];
4648

4749
// Data Source Kind description
4850
eStatGoJpConnector = [
@@ -56,7 +58,8 @@ eStatGoJpConnector = [
5658
Label = Extension.LoadString("DataSourceLabel")
5759
];
5860

59-
// Data Source UI publishing description
61+
62+
//Data Source UI publishing description
6063
eStatGoJpConnector.Publish = [
6164
Beta = true,
6265
Category = "Other",
@@ -88,7 +91,7 @@ CreateNavTableLevel1 = (credentials as any, statId as text, optional lang as tex
8891
objects8 = Table.AddColumn(objects7, "ItemKind", each "View"),
8992
objects9 = Table.AddColumn(objects8, "ItemName", each "View"),
9093
objects10 = Table.AddColumn(objects9, "IsLeaf", each false),
91-
objects11 = Table.RemoveColumns(objects10, {"SURVEY_DATE"}),
94+
objects11 = Table.SelectColumns(objects10, {"Name", "Key", "Data", "ItemKind", "ItemName", "IsLeaf"}),
9295
NavTable = Table.ToNavigationTable(objects11, {"Key"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
9396
in
9497
NavTable;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Use this file to write queries to test your data connector
22
let
3-
result = eStatGoJpConnector.Nav("1: 統計情報")
3+
result = eStatGoJpConnector.Contents(Text.From("1: 統計情報"))
44
in
55
result

0 commit comments

Comments
 (0)