├── .gitattributes ├── .gitignore ├── .gitmodules ├── CODE_OF_CONDUCT.md ├── LICENSE ├── PowerQuerySdk.vsix ├── README.md ├── SECURITY.md ├── blobs ├── credentialPrompt.png ├── credentialPromptWithPath.png ├── credentialPromptWithUrl.png ├── csvDocument.png ├── dataSourceSettingsCreds.png ├── dataSourceSettingsJson.png ├── dataSourceSettingsLabel.png ├── deepDiveVideo.png ├── defaultFunctionInfo.png ├── defaultFunctionPrompt.png ├── graph1.png ├── graph2.png ├── graph3.png ├── graph4.png ├── graph5.png ├── graph6.png ├── graph7.png ├── graph8.png ├── graph9.png ├── helloWorldWithDocs.png ├── helloWorldWithDocsInfo.png ├── helloworld1.png ├── helloworld2.png ├── helloworld3.png ├── itemKinds.png ├── navTableAsTable.png ├── navTableNested.png ├── navTableSample.png ├── navtable.png ├── openapi_apigurus.png ├── pbigetdata.png ├── trippin10UnitTestLog1.png ├── trippin10UnitTestLog2.png ├── trippin1Creds.png ├── trippin1Function.png ├── trippin1GetData.png ├── trippin1Me.png ├── trippin1NavTable.png ├── trippin1Results.png ├── trippin2Airlines.png ├── trippin2Airports.png ├── trippin2FakeNav.png ├── trippin2Fiddler.png ├── trippin2Firewall.png ├── trippin2ODataResult.png ├── trippin2Privacy.png ├── trippin2RawList.png ├── trippin3Nav.png ├── trippin3Query.png ├── trippin3Table.png ├── trippin3Table2.png ├── trippin4Complete.png ├── trippin4CredentialsTab.png ├── trippin4NavigatorOData.png ├── trippin4NewPrompt.png ├── trippin4Paths.png ├── trippin4UriCombine.png ├── trippin5Fiddler.png ├── trippin5Paging.png ├── trippin5People.png ├── trippin6AirlineNoSchema.png ├── trippin6AirlineTableSchema.png ├── trippin6AirlineWithSchema.png ├── trippin6PQNoSchema.png ├── trippin6PQWithSchema.png ├── trippin6PeopleWithSchema.png ├── trippin7UnitTest1.png ├── trippin7UnitTest2.png ├── trippin7UnitTest3.png ├── trippin8EnableTrace.png ├── trippin8Error.png ├── trippin8ErrorLog.png ├── trippin8Log.png ├── trippin8LogFunction.png ├── trippin8ProjectProperties.png ├── trippin8TraceWithType.png ├── trippin9Gateway.png ├── trippin9Navigator.png ├── trippin9Settings1.png ├── trippin9Settings2.png ├── trippin9TestConnection.png ├── unitTestingFailure.png ├── unitTestingSample.png └── vs2017_project.png ├── docs └── README.md ├── editors ├── Crayon │ ├── README.md │ ├── m.txt │ ├── modifier.txt │ ├── operator.txt │ ├── reserved.txt │ ├── statement.txt │ └── type.txt ├── Notepad++ │ ├── README.md │ └── mlang_npp.xml ├── SublimeText │ ├── PowerQueryExpression.tmLanguage │ └── PowerQuerySection.tmLanguage └── vscode │ ├── .vscode │ └── launch.json │ ├── CHANGELOG.md │ ├── README.md │ ├── language-configuration.json │ ├── package.json │ ├── syntaxes │ └── powerqueryexpression.tmLanguage │ └── vsc-extension-quickstart.md ├── samples ├── DataWorldSwagger │ ├── .vscode │ │ └── settings.json │ ├── DataWorldSwagger.pq │ ├── DataWorldSwagger.proj │ ├── DataWorldSwagger.query.pq │ ├── client_id │ ├── client_secret │ └── resources.resx ├── DirectQueryForSQL │ ├── .vscode │ │ └── settings.json │ ├── DirectQueryForSQL.pq │ ├── DirectQueryForSQL.proj │ ├── DirectQueryForSQL.query.pq │ ├── DirectQueryForSQL16.png │ ├── DirectQueryForSQL20.png │ ├── DirectQueryForSQL24.png │ ├── DirectQueryForSQL32.png │ ├── DirectQueryForSQL40.png │ ├── DirectQueryForSQL48.png │ ├── DirectQueryForSQL64.png │ ├── README.md │ └── resources.resx ├── Github │ ├── .vscode │ │ └── settings.json │ ├── README.md │ ├── client_id │ ├── client_secret │ ├── github.pq │ ├── github.proj │ ├── github.query.pq │ ├── github16.png │ ├── github20.png │ ├── github24.png │ ├── github32.png │ ├── github40.png │ ├── github48.png │ ├── github64.png │ └── resources.resx ├── HelloWorld │ ├── .vscode │ │ └── settings.json │ ├── HelloWorld.pq │ ├── HelloWorld.proj │ ├── HelloWorld.query.pq │ ├── HelloWorld16.png │ ├── HelloWorld20.png │ ├── HelloWorld24.png │ ├── HelloWorld32.png │ ├── HelloWorld40.png │ ├── HelloWorld48.png │ ├── HelloWorld64.png │ ├── README.md │ └── resources.resx ├── HelloWorldWithDocs │ ├── .vscode │ │ └── settings.json │ ├── HelloWorldWithDocs.pq │ ├── HelloWorldWithDocs.proj │ ├── HelloWorldWithDocs.query.pq │ └── README.md ├── NativeQuery │ └── ODBC │ │ └── SQL ODBC │ │ ├── Finish │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── OdbcConstants.pqm │ │ ├── SqlODBC.pq │ │ ├── SqlODBC.proj │ │ ├── SqlODBC16.png │ │ ├── SqlODBC20.png │ │ ├── SqlODBC24.png │ │ ├── SqlODBC32.png │ │ ├── SqlODBC40.png │ │ ├── SqlODBC48.png │ │ ├── SqlODBC64.png │ │ └── resources.resx │ │ └── Start │ │ ├── .vscode │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── OdbcConstants.pqm │ │ ├── SqlODBC.pq │ │ ├── SqlODBC.proj │ │ ├── SqlODBC16.png │ │ ├── SqlODBC20.png │ │ ├── SqlODBC24.png │ │ ├── SqlODBC32.png │ │ ├── SqlODBC40.png │ │ ├── SqlODBC48.png │ │ ├── SqlODBC64.png │ │ └── resources.resx ├── NavigationTable │ ├── .vscode │ │ └── settings.json │ ├── NavigationTable.pq │ ├── NavigationTable.proj │ ├── NavigationTable.query.pq │ └── README.md ├── OAuthPKCE │ └── PKCESample.pq ├── ODBC │ ├── HiveSample │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── HiveSample.pq │ │ ├── HiveSample.proj │ │ ├── HiveSample.query.pq │ │ ├── HiveSample16.png │ │ ├── HiveSample20.png │ │ ├── HiveSample24.png │ │ ├── HiveSample32.png │ │ ├── HiveSample40.png │ │ ├── HiveSample48.png │ │ ├── HiveSample64.png │ │ ├── OdbcConstants.pqm │ │ ├── README.md │ │ └── resources.resx │ ├── ImpalaODBC │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── ImpalaODBC.pq │ │ ├── ImpalaODBC.proj │ │ └── ImpalaODBC.query.pq │ ├── RedshiftODBC │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── OdbcConstants.pqm │ │ ├── RedshiftODBC.pq │ │ ├── RedshiftODBC.proj │ │ └── RedshiftODBC.query.pq │ ├── SnowflakeODBC │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── OdbcConstants.pqm │ │ ├── SnowflakeODBC.pq │ │ ├── SnowflakeODBC.proj │ │ └── SnowflakeODBC.query.pq │ └── SqlODBC │ │ ├── .vscode │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── OdbcConstants.pqm │ │ ├── SqlODBC.pq │ │ ├── SqlODBC.proj │ │ ├── SqlODBC.query.pq │ │ ├── SqlODBC16.png │ │ ├── SqlODBC20.png │ │ ├── SqlODBC24.png │ │ ├── SqlODBC32.png │ │ ├── SqlODBC40.png │ │ ├── SqlODBC48.png │ │ ├── SqlODBC64.png │ │ └── resources.resx ├── OData │ └── AnnotationsSample │ │ ├── .vscode │ │ └── settings.json │ │ ├── AnnotationsSample.pq │ │ ├── AnnotationsSample.proj │ │ ├── AnnotationsSample.query.pq │ │ ├── AnnotationsSample16.png │ │ ├── AnnotationsSample20.png │ │ ├── AnnotationsSample24.png │ │ ├── AnnotationsSample32.png │ │ ├── AnnotationsSample40.png │ │ ├── AnnotationsSample48.png │ │ ├── AnnotationsSample64.png │ │ ├── README.md │ │ └── resources.resx ├── OpenApiSample │ ├── .vscode │ │ └── settings.json │ ├── OpenApiSample.pq │ ├── OpenApiSample.proj │ ├── OpenApiSample.query.pq │ ├── README.md │ └── apisGuru.json ├── TripPin │ ├── 1-OData │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 10-TableView1 │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── README.md │ │ ├── Table.ChangeType.pqm │ │ ├── Table.GenerateByPage.pqm │ │ ├── Table.ToNavigationTable.pqm │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 2-Rest │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 3-NavTables │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 4-Paths │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 5-Paging │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 6-Schema │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 7-AdvancedSchema │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── README.md │ │ ├── Table.ChangeType.pqm │ │ ├── Table.GenerateByPage.pqm │ │ ├── Table.ToNavigationTable.pqm │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 8-Diagnostics │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── README.md │ │ ├── Table.ChangeType.pqm │ │ ├── Table.GenerateByPage.pqm │ │ ├── Table.ToNavigationTable.pqm │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ ├── 9-TestConnection │ │ ├── .vscode │ │ │ └── settings.json │ │ ├── Diagnostics.pqm │ │ ├── README.md │ │ ├── Table.ChangeType.pqm │ │ ├── Table.GenerateByPage.pqm │ │ ├── Table.ToNavigationTable.pqm │ │ ├── TripPin.pq │ │ ├── TripPin.proj │ │ └── TripPin.query.pq │ └── README.md ├── UnitTesting │ ├── .vscode │ │ └── settings.json │ ├── README.md │ ├── UnitTesting.pq │ ├── UnitTesting.proj │ └── UnitTesting.query.pq ├── dirs.proj └── global.json └── testframework ├── data ├── PQSDKTestData.md ├── PQSDKTestFrameworkDataSchema.sql ├── nyc_taxi_tripdata.csv └── taxi+_zone_lookup.csv └── tests ├── ConnectorConfigs └── generic │ ├── ParameterQueries │ └── Generic.parameterquery.pq │ └── Settings │ ├── SanitySettings.json │ └── StandardSettings.json ├── PQSDKTestSuites.md ├── RunPQSDKTestSuites.ps1 ├── RunPQSDKTestSuitesSettings.json ├── RunPQSDKTestSuitesSettingsTemplate.json └── TestSuites ├── Sanity ├── Taxi │ ├── AllTypes.query.pq │ ├── AllTypes.query.pqout │ ├── AllTypesRowCount.query.pq │ ├── AllTypesRowCount.query.pqout │ ├── AllTypesSchema.query.pq │ └── AllTypesSchema.query.pqout └── Zone │ ├── AllTypesZone.query.pq │ ├── AllTypesZone.query.pqout │ ├── AllTypesZoneRowCount.query.pq │ ├── AllTypesZoneRowCount.query.pqout │ ├── AllTypesZoneSchema.query.pq │ └── AllTypesZoneSchema.query.pqout └── Standard ├── Datatypes ├── AddColumnSpecialCharacters.query.pq ├── AddColumnSpecialCharacters.query.pqout ├── AllTypesNativeQuery.query.pqout ├── AlltypesNativeQuery.query.pq ├── Cast.query.pq ├── Cast.query.pqout ├── FirstEntry.query.pq ├── FirstEntry.query.pqout ├── IfBoolean.query.pq ├── IfBoolean.query.pqout ├── MultiplyColumnsOfDifferenttypes.query.pq ├── MultiplyColumnsOfDifferenttypes.query.pqout ├── NullableEquals.query.pq ├── NullableEquals.query.pqout ├── SelectRowsBoolColumn.query.pq ├── SelectRowsBoolColumn.query.pqout ├── SkipTake.query.pq ├── SkipTake.query.pqout ├── Sort.query.pq ├── Sort.query.pqout ├── SortDatetime.query.pq ├── SortDatetime.query.pqout ├── SortTimestamp.query.pq └── SortTimestamp.query.pqout ├── Date ├── DateFilter_QueryFolding.query.pq ├── DateFilter_QueryFolding.query.pqout ├── DateFunctions_over_Date_1.query.pq ├── DateFunctions_over_Date_1.query.pqout ├── DateFunctions_over_Date_2.query.pq ├── DateFunctions_over_Date_2.query.pqout ├── DateFunctions_over_Date_3.query.pq ├── DateFunctions_over_Date_3.query.pqout ├── DateFunctions_over_Datetime_1.query.pq ├── DateFunctions_over_Datetime_1.query.pqout ├── DateFunctions_over_Datetime_2a.query.pq ├── DateFunctions_over_Datetime_2a.query.pqout ├── DateFunctions_over_Datetime_2b.query.pq ├── DateFunctions_over_Datetime_2b.query.pqout ├── DateFunctions_over_Datetime_3.query.pq ├── DateFunctions_over_Datetime_3.query.pqout ├── DateFunctions_over_Datetime_4.query.pq ├── DateFunctions_over_Datetime_4.query.pqout ├── DateTimeAddDuration.query.pq ├── DateTimeAddDuration.query.pqout ├── DateTimeArithmetic.query.pq └── DateTimeArithmetic.query.pqout ├── FirstN ├── FirstNGroup.query.pq ├── FirstNGroup.query.pqout ├── FirstNGroupSort.query.pq ├── FirstNGroupSort.query.pqout ├── FirstNSort.query.pq ├── FirstNSort.query.pqout ├── FirstNSortGroup.query.pq └── FirstNSortGroup.query.pqout ├── Functions ├── Count.query.pq ├── Count.query.pqout ├── FoldListAverage.query.pq ├── FoldListAverage.query.pqout ├── FoldListCount.query.pq ├── FoldListCount.query.pqout ├── FoldListFirst.query.pq ├── FoldListFirst.query.pqout ├── FoldListFirstNGroup.query.pq ├── FoldListFirstNGroup.query.pqout ├── FoldListMax.query.pq ├── FoldListMax.query.pqout ├── FoldListMin.query.pq ├── FoldListMin.query.pqout ├── FoldListNotNullCount.query.pq ├── FoldListNotNullCount.query.pqout ├── FoldListStandardDeviation.query.pq ├── FoldListStandardDeviation.query.pqout ├── FoldListSum.query.pq ├── FoldListSum.query.pqout ├── FoldTableRowCount.query.pq ├── FoldTableRowCount.query.pqout ├── FoldsDateTimeComparison.query.pq ├── FoldsDateTimeComparison.query.pqout ├── FoldsTextFromDateTime.query.pq └── FoldsTextFromDateTime.query.pqout ├── Join ├── TableJoin_1.query.pq ├── TableJoin_1.query.pqout ├── TableJoin_2.query.pq ├── TableJoin_2.query.pqout ├── TableJoin_3.query.pq ├── TableJoin_3.query.pqout ├── TableJoin_4.query.pq └── TableJoin_4.query.pqout ├── Math ├── Arithmetic.query.pq ├── Arithmetic.query.pqout ├── NumberFunctions.query.pq ├── NumberFunctions.query.pqout ├── Sum.query.pq └── Sum.query.pqout ├── Metadata ├── CreateNavigationPropertiesOption.query.pq ├── CreateNavigationPropertiesOption.query.pqout ├── NavigationMetadata.query.pq └── NavigationMetadata.query.pqout ├── Text ├── AddColumnWithTextStartsWith.query.pq ├── AddColumnWithTextStartsWith.query.pqout ├── ConcatOverflow.query.pq ├── ConcatOverflow.query.pqout ├── SelectRowsStringColumn.query.pq ├── SelectRowsStringColumn.query.pqout ├── StringLiteral.query.pq ├── StringLiteral.query.pqout ├── TextFromDecimal.query.pq ├── TextFromDecimal.query.pqout ├── TextFunctions.query.pq └── TextFunctions.query.pqout └── Time ├── TimeFunctions_EndOfHour.query.pq ├── TimeFunctions_EndOfHour.query.pqout ├── TimeFunctions_Hour.query.pq ├── TimeFunctions_Hour.query.pqout ├── TimeFunctions_Minute.query.pq ├── TimeFunctions_Minute.query.pqout ├── TimeFunctions_Second.query.pq ├── TimeFunctions_Second.query.pqout ├── TimeFunctions_StartOfHour.query.pq ├── TimeFunctions_StartOfHour.query.pqout ├── TimeFunctions_TimeSecond.query.pq └── TimeFunctions_TimeSecond.query.pqout /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "editors/Atom"] 2 | path = editors/Atom 3 | url = https://github.com/acaprojects/language-m 4 | branch = master 5 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /PowerQuerySdk.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/PowerQuerySdk.vsix -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /blobs/credentialPrompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/credentialPrompt.png -------------------------------------------------------------------------------- /blobs/credentialPromptWithPath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/credentialPromptWithPath.png -------------------------------------------------------------------------------- /blobs/credentialPromptWithUrl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/credentialPromptWithUrl.png -------------------------------------------------------------------------------- /blobs/csvDocument.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/csvDocument.png -------------------------------------------------------------------------------- /blobs/dataSourceSettingsCreds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/dataSourceSettingsCreds.png -------------------------------------------------------------------------------- /blobs/dataSourceSettingsJson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/dataSourceSettingsJson.png -------------------------------------------------------------------------------- /blobs/dataSourceSettingsLabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/dataSourceSettingsLabel.png -------------------------------------------------------------------------------- /blobs/deepDiveVideo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/deepDiveVideo.png -------------------------------------------------------------------------------- /blobs/defaultFunctionInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/defaultFunctionInfo.png -------------------------------------------------------------------------------- /blobs/defaultFunctionPrompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/defaultFunctionPrompt.png -------------------------------------------------------------------------------- /blobs/graph1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph1.png -------------------------------------------------------------------------------- /blobs/graph2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph2.png -------------------------------------------------------------------------------- /blobs/graph3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph3.png -------------------------------------------------------------------------------- /blobs/graph4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph4.png -------------------------------------------------------------------------------- /blobs/graph5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph5.png -------------------------------------------------------------------------------- /blobs/graph6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph6.png -------------------------------------------------------------------------------- /blobs/graph7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph7.png -------------------------------------------------------------------------------- /blobs/graph8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph8.png -------------------------------------------------------------------------------- /blobs/graph9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/graph9.png -------------------------------------------------------------------------------- /blobs/helloWorldWithDocs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/helloWorldWithDocs.png -------------------------------------------------------------------------------- /blobs/helloWorldWithDocsInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/helloWorldWithDocsInfo.png -------------------------------------------------------------------------------- /blobs/helloworld1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/helloworld1.png -------------------------------------------------------------------------------- /blobs/helloworld2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/helloworld2.png -------------------------------------------------------------------------------- /blobs/helloworld3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/helloworld3.png -------------------------------------------------------------------------------- /blobs/itemKinds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/itemKinds.png -------------------------------------------------------------------------------- /blobs/navTableAsTable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/navTableAsTable.png -------------------------------------------------------------------------------- /blobs/navTableNested.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/navTableNested.png -------------------------------------------------------------------------------- /blobs/navTableSample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/navTableSample.png -------------------------------------------------------------------------------- /blobs/navtable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/navtable.png -------------------------------------------------------------------------------- /blobs/openapi_apigurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/openapi_apigurus.png -------------------------------------------------------------------------------- /blobs/pbigetdata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/pbigetdata.png -------------------------------------------------------------------------------- /blobs/trippin10UnitTestLog1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin10UnitTestLog1.png -------------------------------------------------------------------------------- /blobs/trippin10UnitTestLog2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin10UnitTestLog2.png -------------------------------------------------------------------------------- /blobs/trippin1Creds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin1Creds.png -------------------------------------------------------------------------------- /blobs/trippin1Function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin1Function.png -------------------------------------------------------------------------------- /blobs/trippin1GetData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin1GetData.png -------------------------------------------------------------------------------- /blobs/trippin1Me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin1Me.png -------------------------------------------------------------------------------- /blobs/trippin1NavTable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin1NavTable.png -------------------------------------------------------------------------------- /blobs/trippin1Results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin1Results.png -------------------------------------------------------------------------------- /blobs/trippin2Airlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin2Airlines.png -------------------------------------------------------------------------------- /blobs/trippin2Airports.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin2Airports.png -------------------------------------------------------------------------------- /blobs/trippin2FakeNav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin2FakeNav.png -------------------------------------------------------------------------------- /blobs/trippin2Fiddler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin2Fiddler.png -------------------------------------------------------------------------------- /blobs/trippin2Firewall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin2Firewall.png -------------------------------------------------------------------------------- /blobs/trippin2ODataResult.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin2ODataResult.png -------------------------------------------------------------------------------- /blobs/trippin2Privacy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin2Privacy.png -------------------------------------------------------------------------------- /blobs/trippin2RawList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin2RawList.png -------------------------------------------------------------------------------- /blobs/trippin3Nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin3Nav.png -------------------------------------------------------------------------------- /blobs/trippin3Query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin3Query.png -------------------------------------------------------------------------------- /blobs/trippin3Table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin3Table.png -------------------------------------------------------------------------------- /blobs/trippin3Table2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin3Table2.png -------------------------------------------------------------------------------- /blobs/trippin4Complete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin4Complete.png -------------------------------------------------------------------------------- /blobs/trippin4CredentialsTab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin4CredentialsTab.png -------------------------------------------------------------------------------- /blobs/trippin4NavigatorOData.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin4NavigatorOData.png -------------------------------------------------------------------------------- /blobs/trippin4NewPrompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin4NewPrompt.png -------------------------------------------------------------------------------- /blobs/trippin4Paths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin4Paths.png -------------------------------------------------------------------------------- /blobs/trippin4UriCombine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin4UriCombine.png -------------------------------------------------------------------------------- /blobs/trippin5Fiddler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin5Fiddler.png -------------------------------------------------------------------------------- /blobs/trippin5Paging.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin5Paging.png -------------------------------------------------------------------------------- /blobs/trippin5People.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin5People.png -------------------------------------------------------------------------------- /blobs/trippin6AirlineNoSchema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin6AirlineNoSchema.png -------------------------------------------------------------------------------- /blobs/trippin6AirlineTableSchema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin6AirlineTableSchema.png -------------------------------------------------------------------------------- /blobs/trippin6AirlineWithSchema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin6AirlineWithSchema.png -------------------------------------------------------------------------------- /blobs/trippin6PQNoSchema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin6PQNoSchema.png -------------------------------------------------------------------------------- /blobs/trippin6PQWithSchema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin6PQWithSchema.png -------------------------------------------------------------------------------- /blobs/trippin6PeopleWithSchema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin6PeopleWithSchema.png -------------------------------------------------------------------------------- /blobs/trippin7UnitTest1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin7UnitTest1.png -------------------------------------------------------------------------------- /blobs/trippin7UnitTest2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin7UnitTest2.png -------------------------------------------------------------------------------- /blobs/trippin7UnitTest3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin7UnitTest3.png -------------------------------------------------------------------------------- /blobs/trippin8EnableTrace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin8EnableTrace.png -------------------------------------------------------------------------------- /blobs/trippin8Error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin8Error.png -------------------------------------------------------------------------------- /blobs/trippin8ErrorLog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin8ErrorLog.png -------------------------------------------------------------------------------- /blobs/trippin8Log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin8Log.png -------------------------------------------------------------------------------- /blobs/trippin8LogFunction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin8LogFunction.png -------------------------------------------------------------------------------- /blobs/trippin8ProjectProperties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin8ProjectProperties.png -------------------------------------------------------------------------------- /blobs/trippin8TraceWithType.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin8TraceWithType.png -------------------------------------------------------------------------------- /blobs/trippin9Gateway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin9Gateway.png -------------------------------------------------------------------------------- /blobs/trippin9Navigator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin9Navigator.png -------------------------------------------------------------------------------- /blobs/trippin9Settings1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin9Settings1.png -------------------------------------------------------------------------------- /blobs/trippin9Settings2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin9Settings2.png -------------------------------------------------------------------------------- /blobs/trippin9TestConnection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/trippin9TestConnection.png -------------------------------------------------------------------------------- /blobs/unitTestingFailure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/unitTestingFailure.png -------------------------------------------------------------------------------- /blobs/unitTestingSample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/unitTestingSample.png -------------------------------------------------------------------------------- /blobs/vs2017_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/blobs/vs2017_project.png -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | Docs have been moved to the [Power Query documentation repo](https://learn.microsoft.com/power-query/install-sdk). 2 | -------------------------------------------------------------------------------- /editors/Crayon/README.md: -------------------------------------------------------------------------------- 1 | M language files for the [Crayon Syntax Highlighter](https://wordpress.org/plugins/crayon-syntax-highlighter/) wordpress plugin. -------------------------------------------------------------------------------- /editors/Crayon/m.txt: -------------------------------------------------------------------------------- 1 | ### Power Query M LANGUAGE ### 2 | 3 | # ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION 4 | 5 | NAME M 6 | VERSION 0.1 7 | 8 | COMMENT (?default) 9 | PREPROCESSOR (?default) 10 | STRING (?default) 11 | 12 | STATEMENT \b(?alt:statement.txt)\b 13 | RESERVED \b(?alt:reserved.txt)\b 14 | TYPE \b(?alt:type.txt)\b 15 | MODIFIER \b(?alt:modifier.txt)\b 16 | 17 | ENTITY (?default) 18 | VARIABLE (?default) 19 | IDENTIFIER (?default) 20 | CONSTANT (?default) 21 | OPERATOR \b(?alt:operator.txt)\b 22 | SYMBOL (?default) 23 | -------------------------------------------------------------------------------- /editors/Crayon/modifier.txt: -------------------------------------------------------------------------------- 1 | optional 2 | nullable 3 | 4 | -------------------------------------------------------------------------------- /editors/Crayon/operator.txt: -------------------------------------------------------------------------------- 1 | # Grouped operators 2 | => 3 | .. 4 | ... 5 | <> 6 | <= 7 | >= 8 | 9 | # Single operators 10 | , 11 | ; 12 | = 13 | & 14 | @ 15 | ! 16 | ? 17 | = 18 | < 19 | > 20 | + 21 | = 22 | * 23 | / 24 | or 25 | and 26 | not -------------------------------------------------------------------------------- /editors/Crayon/reserved.txt: -------------------------------------------------------------------------------- 1 | meta 2 | as 3 | else 4 | error 5 | if 6 | is 7 | otherwise 8 | section 9 | shared 10 | then 11 | try 12 | type 13 | each 14 | is 15 | let 16 | in -------------------------------------------------------------------------------- /editors/Crayon/type.txt: -------------------------------------------------------------------------------- 1 | binary 2 | date 3 | datetime 4 | datetimezone 5 | duration 6 | infinity 7 | nan 8 | sections 9 | shared 10 | table 11 | time 12 | #binary 13 | #date 14 | #datetime 15 | #datetimezone 16 | #duration 17 | #infinity 18 | #nan 19 | #sections 20 | #shared 21 | #table 22 | #time 23 | function -------------------------------------------------------------------------------- /editors/Notepad++/README.md: -------------------------------------------------------------------------------- 1 | Language file for [Notepad++](https://notepad-plus-plus.org/) -------------------------------------------------------------------------------- /editors/vscode/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Launch Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ] 11 | } 12 | ] 13 | } -------------------------------------------------------------------------------- /editors/vscode/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to the "powerquerymlanguage" extension will be documented in this file. 3 | 4 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 5 | 6 | ## [Unreleased] 7 | - Initial release -------------------------------------------------------------------------------- /editors/vscode/README.md: -------------------------------------------------------------------------------- 1 | # Power Query M Language README 2 | 3 | This extension adds support for .m and .pq files that contain Power Query M Language. This is a shell around the [tmLanguage file that Wayne Steele created](https://github.com/Microsoft/DataConnectors/blob/master/editors/SublimeText/PowerQueryExpression.tmLanguage). 4 | 5 | ## Features 6 | 7 | Adds Power Query M Language colorization, auto-closing and surrounding support. 8 | 9 | ## Release Notes 10 | 11 | Initial release 12 | -------------------------------------------------------------------------------- /editors/vscode/language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": "//", 5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments 6 | "blockComment": [ "/*", "*/" ] 7 | }, 8 | // symbols used as brackets 9 | "brackets": [ 10 | ["{", "}"], 11 | ["[", "]"], 12 | ["(", ")"] 13 | ], 14 | // symbols that are auto closed when typing 15 | "autoClosingPairs": [ 16 | ["{", "}"], 17 | ["[", "]"], 18 | ["(", ")"], 19 | ["\"", "\""], 20 | ["#\"", "\""], 21 | ["#(", ")"] 22 | ], 23 | // symbols that that can be used to surround a selection 24 | "surroundingPairs": [ 25 | ["{", "}"], 26 | ["[", "]"], 27 | ["(", ")"], 28 | ["\"", "\""], 29 | ["#\"", "\""], 30 | ["#(", ")"] 31 | ] 32 | } -------------------------------------------------------------------------------- /editors/vscode/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "powerquerymlanguage", 3 | "displayName": "Power Query M Language", 4 | "description": "Support for Power Query M Language", 5 | "version": "1.0.0", 6 | "publisher": "sea1jxr", 7 | "engines": { 8 | "vscode": "^1.16.0" 9 | }, 10 | "categories": [ 11 | "Languages" 12 | ], 13 | "contributes": { 14 | "languages": [ 15 | { 16 | "id": "powerquerymlanguage", 17 | "aliases": [ 18 | "powerquerymlanguage", 19 | "powerquerymlanguage" 20 | ], 21 | "extensions": [ 22 | ".pq", 23 | ".PQ", 24 | ".m", 25 | ".M" 26 | ], 27 | "configuration": "./language-configuration.json" 28 | } 29 | ], 30 | "grammars": [ 31 | { 32 | "language": "powerquerymlanguage", 33 | "scopeName": "source.powerquerymlanguage", 34 | "path": "./syntaxes/powerqueryexpression.tmLanguage" 35 | } 36 | ] 37 | } 38 | } -------------------------------------------------------------------------------- /editors/vscode/vsc-extension-quickstart.md: -------------------------------------------------------------------------------- 1 | # Welcome to your VS Code Extension 2 | 3 | ## What's in the folder 4 | * This folder contains all of the files necessary for your extension 5 | * `package.json` - this is the manifest file in which you declare your language support and define 6 | the location of the grammar file that has been copied into you extension. 7 | * `syntaxes/powerquerymlanguage.tmLanguage` - this is the Text mate grammar file that is used for tokenization 8 | * `language-configuration.json` - this the language configuration, defining the tokens that are used for 9 | comments and brackets. 10 | 11 | ## Get up and running straight away 12 | * Make sure the language configuration settings in `language-configuration.json` are accurate 13 | * press `F5` to open a new window with your extension loaded 14 | * create a new file with a file name suffix matching your language 15 | * verify that syntax highlight works and that the language configuration settings are working 16 | 17 | ## Make changes 18 | * you can relaunch the extension from the debug toolbar after making changes to the files listed above 19 | * you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes 20 | 21 | ## Add more language features 22 | * To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at 23 | https://code.visualstudio.com/docs 24 | 25 | ## Install your extension 26 | * To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. 27 | * To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. -------------------------------------------------------------------------------- /samples/DataWorldSwagger/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/DataWorldSwagger/DataWorldSwagger.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /samples/DataWorldSwagger/DataWorldSwagger.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | let result = DataWorldSwagger.Contents() in result 3 | -------------------------------------------------------------------------------- /samples/DataWorldSwagger/client_id: -------------------------------------------------------------------------------- 1 | xxxxxx -------------------------------------------------------------------------------- /samples/DataWorldSwagger/client_secret: -------------------------------------------------------------------------------- 1 | xxxxx -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL.query.pq: -------------------------------------------------------------------------------- 1 | //Use this file to write queries. 2 | let 3 | Host = "localhost", 4 | Database = "AdventureWorksDW2012", 5 | Source = DirectSQL.Database(Host, Database), 6 | dbo_Schema = Source{[Name = "dbo", Kind = "Schema"]}[Data] 7 | in 8 | dbo_Schema 9 | -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/DirectQueryForSQL/DirectQueryForSQL16.png -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/DirectQueryForSQL/DirectQueryForSQL20.png -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/DirectQueryForSQL/DirectQueryForSQL24.png -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/DirectQueryForSQL/DirectQueryForSQL32.png -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/DirectQueryForSQL/DirectQueryForSQL40.png -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/DirectQueryForSQL/DirectQueryForSQL48.png -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/DirectQueryForSQL64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/DirectQueryForSQL/DirectQueryForSQL64.png -------------------------------------------------------------------------------- /samples/DirectQueryForSQL/README.md: -------------------------------------------------------------------------------- 1 | # Direct Query using SQL Server ODBC 2 | 3 | This sample creates an ODBC based custom connector that enables Direct Query for SQL Server. 4 | 5 | The code does the following: 6 | 7 | * Declares a new data source kind (DirectSQL) 8 | * Builds a `record` containing connection string properties specific to the `SQL Server Native Client 11.0` driver 9 | * Sets credential related connection string properties separately 10 | * Overrides default ODBC capabilities returned by the driver 11 | * Wraps M's built-in ODBC function - `Odbc.DataSource` 12 | 13 | Please see the comments in the code for more details. 14 | -------------------------------------------------------------------------------- /samples/Github/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/Github/README.md: -------------------------------------------------------------------------------- 1 | # Tutorial found at PQ Docs 2 | 3 | Please see the [Github Tutorial](https://learn.microsoft.com/power-query/samples/github/readme) in the PQ Docs. 4 | -------------------------------------------------------------------------------- /samples/Github/client_id: -------------------------------------------------------------------------------- 1 | xxxxxxxxxxxxxxxxx -------------------------------------------------------------------------------- /samples/Github/client_secret: -------------------------------------------------------------------------------- 1 | xxxxxxxxxxxxxxxxx -------------------------------------------------------------------------------- /samples/Github/github.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/Github/github.query.pq: -------------------------------------------------------------------------------- 1 | // This is where you can write sample queries to test your extension. 2 | let 3 | source = GithubSample.Contents("https://api.github.com/") 4 | in 5 | source 6 | -------------------------------------------------------------------------------- /samples/Github/github16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/Github/github16.png -------------------------------------------------------------------------------- /samples/Github/github20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/Github/github20.png -------------------------------------------------------------------------------- /samples/Github/github24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/Github/github24.png -------------------------------------------------------------------------------- /samples/Github/github32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/Github/github32.png -------------------------------------------------------------------------------- /samples/Github/github40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/Github/github40.png -------------------------------------------------------------------------------- /samples/Github/github48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/Github/github48.png -------------------------------------------------------------------------------- /samples/Github/github64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/Github/github64.png -------------------------------------------------------------------------------- /samples/HelloWorld/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld.pq: -------------------------------------------------------------------------------- 1 | section HelloWorld; 2 | 3 | [DataSource.Kind = "HelloWorld", Publish = "HelloWorld.Publish"] 4 | shared HelloWorld.Contents = (optional message as text) => 5 | let 6 | message = if (message <> null) then message else "Hello world" 7 | in 8 | message; 9 | 10 | HelloWorld = [ 11 | TestConnection = (dataSourcePath) => {"HelloWorld.Contents"}, 12 | Authentication = [ 13 | Anonymous = [] 14 | ] 15 | ]; 16 | 17 | HelloWorld.Publish = [ 18 | Beta = true, 19 | ButtonText = {Extension.LoadString("FormulaTitle"), Extension.LoadString("FormulaHelp")}, 20 | SourceImage = HelloWorld.Icons, 21 | SourceTypeImage = HelloWorld.Icons 22 | ]; 23 | 24 | HelloWorld.Icons = [ 25 | Icon16 = { 26 | Extension.Contents("HelloWorld16.png"), 27 | Extension.Contents("HelloWorld20.png"), 28 | Extension.Contents("HelloWorld24.png"), 29 | Extension.Contents("HelloWorld32.png") 30 | }, 31 | Icon32 = { 32 | Extension.Contents("HelloWorld32.png"), 33 | Extension.Contents("HelloWorld40.png"), 34 | Extension.Contents("HelloWorld48.png"), 35 | Extension.Contents("HelloWorld64.png") 36 | } 37 | ]; 38 | -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld.query.pq: -------------------------------------------------------------------------------- 1 | //Use this file to write queries. 2 | HelloWorld.Contents("hello this is my message") 3 | -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/HelloWorld/HelloWorld16.png -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/HelloWorld/HelloWorld20.png -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/HelloWorld/HelloWorld24.png -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/HelloWorld/HelloWorld32.png -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/HelloWorld/HelloWorld40.png -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/HelloWorld/HelloWorld48.png -------------------------------------------------------------------------------- /samples/HelloWorld/HelloWorld64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/HelloWorld/HelloWorld64.png -------------------------------------------------------------------------------- /samples/HelloWorld/README.md: -------------------------------------------------------------------------------- 1 | # Hello World Sample 2 | 3 | This sample provides a simple data source extension that can be run in Visual Studio, and loaded in Power BI Desktop. As an overview, this sample shows the following: 4 | 5 | * Exporting function (HelloWorld.Contents), which takes an option text parameter. 6 | * Defining a data source kind that: 7 | * Declares that it uses Implicit (anonymous) authentication. 8 | * Uses string resources that allow for localization. 9 | * Declaring UI metadata so the extension can show up in the Power BI Desktop Get Data dialog. 10 | 11 | ## Get Data dialog in Power BI Desktop 12 | 13 | ![GetData] 14 | 15 | ## Authentication dialog 16 | 17 | ![Auth] 18 | 19 | ## Query editor 20 | 21 | ![Query] 22 | 23 | [GetData]: ../../blobs/helloworld1.png "Hello World in Get Data" 24 | [Auth]: ../../blobs/helloworld2.png "Hello World authentication dialog" 25 | [Query]: ../../blobs/helloworld3.png "Hello World in the query editor" 26 | -------------------------------------------------------------------------------- /samples/HelloWorldWithDocs/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/HelloWorldWithDocs/HelloWorldWithDocs.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/HelloWorldWithDocs/HelloWorldWithDocs.query.pq: -------------------------------------------------------------------------------- 1 | let 2 | Source = HelloWorldWithDocs.Contents("Hello world", 2, [ ]), 3 | WithOptions = HelloWorldWithDocs.Contents("With Options", 1, [ enumField = "option2"]) 4 | in 5 | // Source 6 | WithOptions 7 | -------------------------------------------------------------------------------- /samples/HelloWorldWithDocs/README.md: -------------------------------------------------------------------------------- 1 | # Hello World with Documentation 2 | 3 | This sample shows how to add documentation to your shared functions. To simply the code sample, the project is not using string or icon resources. In a real extension, you would use `Extension.LoadString` to load (localized) strings from your resources.resx file. 4 | 5 | **Function invocation** 6 | ![FunctionPrompt](../../blobs/helloWorldWithDocs.png "Hello world with docs prompt") 7 | 8 | **Function info** 9 | ![FunctionInfo](../../blobs/helloWorldWithDocsInfo.png "Hello world with docs function info") 10 | -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\SqlODBC.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\SqlODBC.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC16.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC20.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC24.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC32.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC40.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC48.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Finish/SqlODBC64.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\SqlODBC.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\SqlODBC.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC16.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC20.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC24.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC32.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC40.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC48.png -------------------------------------------------------------------------------- /samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/NativeQuery/ODBC/SQL ODBC/Start/SqlODBC64.png -------------------------------------------------------------------------------- /samples/NavigationTable/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/NavigationTable/NavigationTable.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/NavigationTable/NavigationTable.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | let result = NavigationTable.Icons() in result 3 | -------------------------------------------------------------------------------- /samples/NavigationTable/README.md: -------------------------------------------------------------------------------- 1 | # Navigation Table Sample 2 | 3 | This sample provides two examples of how to create a navigation table for your data connector using the `Table.ToNavigationTable` function. 4 | 5 | Please see [Handling Navigation Tables](https://docs.microsoft.com/en-us/power-query/handlingnavigationtables) in the PQ Docs for a full write up. 6 | -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample.query.pq: -------------------------------------------------------------------------------- 1 | // Tested with Hortonworks Sandbox 2 | let 3 | Source = HiveSample.Contents("127.0.0.1", 10500), 4 | HIVE_Database = Source{[Name = "HIVE", Kind = "Database"]}[Data], 5 | foodmart_Schema = HIVE_Database{[Name = "foodmart", Kind = "Schema"]}[Data], 6 | customer_Table = foodmart_Schema{[Name = "customer", Kind = "Table"]}[Data], 7 | #"Kept First Rows" = Table.FirstN(customer_Table, 5) 8 | in 9 | #"Kept First Rows" 10 | -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/HiveSample/HiveSample16.png -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/HiveSample/HiveSample20.png -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/HiveSample/HiveSample24.png -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/HiveSample/HiveSample32.png -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/HiveSample/HiveSample40.png -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/HiveSample/HiveSample48.png -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/HiveSample64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/HiveSample/HiveSample64.png -------------------------------------------------------------------------------- /samples/ODBC/HiveSample/README.md: -------------------------------------------------------------------------------- 1 | # Hive LLAP Sample 2 | 3 | This connector sample uses the Hive ODBC driver, and is based on the [connector template](../SqlODBC). 4 | 5 | The current code uses the [Microsoft Hive ODBC driver](https://www.microsoft.com/en-us/download/details.aspx?id=40886), but was also tested with the [Hortonworks Hive ODBC driver](https://hortonworks.com/downloads/). Other Hive drivers may require different connection string parameters. 6 | 7 | To change the driver you wish to use, change the `Config_DriverName` value in `HiveSample.pq`. 8 | 9 | > Please note that this sample enables Direct Query, which should only be used with [Hive LLAP](https://cwiki.apache.org/confluence/display/Hive/LLAP) / interactive mode. Power BI Desktop users that wish to connect to Hive LLAP on HD Insight should use the built-in [HDInsight Interactive Query connector](https://docs.microsoft.com/en-us/azure/hdinsight/interactive-query/apache-hadoop-connect-hive-power-bi-directquery) instead of this custom connector. -------------------------------------------------------------------------------- /samples/ODBC/ImpalaODBC/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/ODBC/ImpalaODBC/ImpalaODBC.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/ODBC/ImpalaODBC/ImpalaODBC.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | let result = ImpalaODBC.Databases("localhost") in result 3 | -------------------------------------------------------------------------------- /samples/ODBC/RedshiftODBC/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/ODBC/RedshiftODBC/RedshiftODBC.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/ODBC/RedshiftODBC/RedshiftODBC.query.pq: -------------------------------------------------------------------------------- 1 | let result = RedshiftODBC.Database("server.redshift.amazonaws.com:5439", "database") in result 2 | -------------------------------------------------------------------------------- /samples/ODBC/SnowflakeODBC/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/ODBC/SnowflakeODBC/SnowflakeODBC.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/ODBC/SnowflakeODBC/SnowflakeODBC.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | let result = SnowflakeODBC.Databases("server", "warehouse") in result 3 | -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | let 3 | result = SqlODBC.Contents("localhost"), 4 | db = result{[Name = "master"]}[Data], 5 | schema = db{[Name = "sys"]}[Data], 6 | allViews = schema{[Name = "all_views"]}[Data] 7 | in 8 | Table.FirstN(allViews, 5) 9 | -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/SqlODBC/SqlODBC16.png -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/SqlODBC/SqlODBC20.png -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/SqlODBC/SqlODBC24.png -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/SqlODBC/SqlODBC32.png -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/SqlODBC/SqlODBC40.png -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/SqlODBC/SqlODBC48.png -------------------------------------------------------------------------------- /samples/ODBC/SqlODBC/SqlODBC64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/ODBC/SqlODBC/SqlODBC64.png -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample.query.pq: -------------------------------------------------------------------------------- 1 | AnnotationsSample.Contents() 2 | -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/OData/AnnotationsSample/AnnotationsSample16.png -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/OData/AnnotationsSample/AnnotationsSample20.png -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/OData/AnnotationsSample/AnnotationsSample24.png -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/OData/AnnotationsSample/AnnotationsSample32.png -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/OData/AnnotationsSample/AnnotationsSample40.png -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/OData/AnnotationsSample/AnnotationsSample48.png -------------------------------------------------------------------------------- /samples/OData/AnnotationsSample/AnnotationsSample64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/DataConnectors/9fb5c1d748bdd5f7ba92bc035564da9a97fd8fef/samples/OData/AnnotationsSample/AnnotationsSample64.png -------------------------------------------------------------------------------- /samples/OpenApiSample/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/OpenApiSample/OpenApiSample.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/OpenApiSample/OpenApiSample.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | let result = OpenApiSample.ApisGuru() in result 3 | -------------------------------------------------------------------------------- /samples/TripPin/1-OData/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/1-OData/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 1 - Data Connector for an OData Service 2 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially – each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 3 | 4 | In this lesson, you will: 5 | * Create a new Data Connector project using the Visual Studio SDK 6 | * Author a base function to pull data from a source 7 | * Test your connector in Visual Studio 8 | * Register your connector in Power BI Desktop 9 | 10 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/1-odata/readme). -------------------------------------------------------------------------------- /samples/TripPin/1-OData/TripPin.pq: -------------------------------------------------------------------------------- 1 | section TripPin; 2 | 3 | [DataSource.Kind = "TripPin", Publish = "TripPin.Publish"] 4 | shared TripPin.Feed = Value.ReplaceType(TripPinImpl, type function (url as Uri.Type) as any); 5 | 6 | TripPinImpl = (url as text) => let source = OData.Feed(url) in source; 7 | 8 | // Data Source Kind description 9 | TripPin = [ 10 | // Declares the supported type(s) of authentication. 11 | // In this case, Implicit = Anonymous web access 12 | Authentication = [ 13 | Anonymous = [] 14 | ], 15 | // Assigns a label to the data source credential. 16 | // This will be displayed in the "Manage Data Sources" dialog. 17 | Label = "TripPin Part 1 - OData" 18 | ]; 19 | 20 | // Data Source UI publishing description 21 | TripPin.Publish = [ 22 | Beta = true, 23 | Category = "Other", 24 | ButtonText = {"TripPin OData", "TripPin OData"} 25 | ]; 26 | -------------------------------------------------------------------------------- /samples/TripPin/1-OData/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/1-OData/TripPin.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | let result = TripPin.Feed("http://services.odata.org/v4/TripPinService/") in result 3 | -------------------------------------------------------------------------------- /samples/TripPin/10-TableView1/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/10-TableView1/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 10 - Query Folding (part 1) 2 | 3 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially - each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 4 | 5 | In this lesson, you will: 6 | 7 | * Learn the basics of query folding 8 | * Learn about the `Table.View` function 9 | * Replicate OData query folding handlers for 10 | * `$top` 11 | * `$skip` 12 | * `$count` 13 | * `$select` 14 | * `$orderby` 15 | 16 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/10-tableview1/readme). 17 | -------------------------------------------------------------------------------- /samples/TripPin/10-TableView1/Table.GenerateByPage.pqm: -------------------------------------------------------------------------------- 1 | (getNextPage as function) as table => 2 | let 3 | listOfPages = List.Generate( 4 | // get the first page of data 5 | () => getNextPage(null), 6 | // stop when the function returns null 7 | (lastPage) => lastPage <> null, 8 | // pass the previous page to the next function call 9 | (lastPage) => getNextPage(lastPage) 10 | ), 11 | // concatenate the pages together 12 | tableOfPages = Table.FromList(listOfPages, Splitter.SplitByNothing(), {"Column1"}), 13 | firstRow = tableOfPages{0} ? 14 | in 15 | // if we didn't get back any pages of data, return an empty table 16 | // otherwise set the table type based on the columns of the first page 17 | if (firstRow = null) then 18 | Table.FromRows({}) 19 | // check for empty first table 20 | else if (Table.IsEmpty(firstRow[Column1])) then 21 | firstRow[Column1] 22 | else 23 | Value.ReplaceType( 24 | Table.ExpandTableColumn(tableOfPages, "Column1", Table.ColumnNames(firstRow[Column1])), 25 | Value.Type(firstRow[Column1]) 26 | ) 27 | -------------------------------------------------------------------------------- /samples/TripPin/10-TableView1/Table.ToNavigationTable.pqm: -------------------------------------------------------------------------------- 1 | ( 2 | table as table, 3 | keyColumns as list, 4 | nameColumn as text, 5 | dataColumn as text, 6 | itemKindColumn as text, 7 | itemNameColumn as text, 8 | isLeafColumn as text 9 | ) as table => 10 | let 11 | tableType = Value.Type(table), 12 | newTableType = Type.AddTableKey(tableType, keyColumns, true) meta [ 13 | NavigationTable.NameColumn = nameColumn, 14 | NavigationTable.DataColumn = dataColumn, 15 | NavigationTable.ItemKindColumn = itemKindColumn, 16 | Preview.DelayColumn = itemNameColumn, 17 | NavigationTable.IsLeafColumn = isLeafColumn 18 | ], 19 | navigationTable = Value.ReplaceType(table, newTableType) 20 | in 21 | navigationTable 22 | -------------------------------------------------------------------------------- /samples/TripPin/10-TableView1/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/2-Rest/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/2-Rest/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 2 - Data Connector for a REST Service 2 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially - 3 | each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 4 | 5 | In this lesson, you will: 6 | 7 | * Create a base function that calls out to a REST API using [Web.Contents](https://msdn.microsoft.com/library/mt260892.aspx) 8 | * Learn how to set request headers and process a JSON response 9 | * Use Power BI Desktop to wrangle the response into a user friend format 10 | 11 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/2-rest/readme). -------------------------------------------------------------------------------- /samples/TripPin/2-Rest/TripPin.pq: -------------------------------------------------------------------------------- 1 | section TripPin; 2 | 3 | [DataSource.Kind = "TripPin", Publish = "TripPin.Publish"] 4 | shared TripPin.Feed = Value.ReplaceType(TripPinImpl, type function (url as Uri.Type) as any); 5 | 6 | DefaultRequestHeaders = [ 7 | // column name and values only 8 | #"Accept" = "application/json;odata.metadata=minimal", 9 | // we only support v4 10 | #"OData-MaxVersion" = "4.0" 11 | ]; 12 | 13 | TripPinImpl = (url as text) => 14 | let 15 | source = Web.Contents(url, [Headers = DefaultRequestHeaders]), json = Json.Document(source) 16 | in 17 | json; 18 | 19 | // Data Source Kind description 20 | TripPin = [ 21 | Authentication = [ 22 | Anonymous = [] 23 | ], 24 | Label = "TripPin Part 2 - REST" 25 | ]; 26 | 27 | // Data Source UI publishing description 28 | TripPin.Publish = [ 29 | Beta = true, 30 | Category = "Other", 31 | ButtonText = {"TripPin REST", "TripPin REST"} 32 | ]; 33 | -------------------------------------------------------------------------------- /samples/TripPin/2-Rest/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/2-Rest/TripPin.query.pq: -------------------------------------------------------------------------------- 1 | // Use this file to write queries to test your data connector 2 | let result = TripPin.Feed("http://services.odata.org/v4/TripPinService/Me") in result 3 | -------------------------------------------------------------------------------- /samples/TripPin/3-NavTables/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/3-NavTables/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 3 - Navigation Tables 2 | 3 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially - each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 4 | 5 | In this lesson, you will: 6 | 7 | * Create a navigation table for a fixed set of queries 8 | * Test the navigation table in Power BI Desktop 9 | 10 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/3-navtables/readme). 11 | -------------------------------------------------------------------------------- /samples/TripPin/3-NavTables/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/3-NavTables/TripPin.query.pq: -------------------------------------------------------------------------------- 1 | TripPin.Contents("http://services.odata.org/v4/TripPinService/") 2 | -------------------------------------------------------------------------------- /samples/TripPin/4-Paths/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/4-Paths/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 4 - Data Source Paths 2 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially – each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 3 | 4 | In this lesson, you will: 5 | 6 | * Simplify the connection logic for our connector 7 | * Improve the navigation table experience 8 | -------------------------------------------------------------------------------- /samples/TripPin/4-Paths/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/4-Paths/TripPin.query.pq: -------------------------------------------------------------------------------- 1 | TripPin.Contents() 2 | -------------------------------------------------------------------------------- /samples/TripPin/5-Paging/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/5-Paging/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 5 - Paging 2 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially – each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 3 | 4 | In this lesson, you will: 5 | 6 | * Add paging support to the connector 7 | 8 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/5-paging/readme). -------------------------------------------------------------------------------- /samples/TripPin/5-Paging/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/5-Paging/TripPin.query.pq: -------------------------------------------------------------------------------- 1 | let 2 | source = TripPin.Contents(), 3 | data = source{[Name = "People"]}[Data], 4 | withRowCount = Table.AddIndexColumn(data, "Index") 5 | in 6 | withRowCount 7 | -------------------------------------------------------------------------------- /samples/TripPin/6-Schema/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/6-Schema/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 6 - Schema 2 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially – each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 3 | 4 | In this lesson, you will: 5 | 6 | * Define a fixed schema for a Rest API 7 | * Dynamically set data types for columns 8 | * Enforce a table structure to avoid transformation errors due to missing columns 9 | * Hide columns from the result set 10 | 11 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/6-schema/readme). -------------------------------------------------------------------------------- /samples/TripPin/6-Schema/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/6-Schema/TripPin.query.pq: -------------------------------------------------------------------------------- 1 | let source = TripPin.Contents(), data = source{[Name = "People"]}[Data] in Table.Schema(data) 2 | -------------------------------------------------------------------------------- /samples/TripPin/7-AdvancedSchema/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/7-AdvancedSchema/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 7 - Advanced Schema with M Types 2 | 3 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially � each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 4 | 5 | In this lesson, you will: 6 | 7 | * Enforce a table schema using [M Types](https://msdn.microsoft.com/library/mt809131.aspx) 8 | * Set types for nested records and lists 9 | * Refactor code for reuse and unit testing 10 | 11 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/7-advancedschema/readme). 12 | -------------------------------------------------------------------------------- /samples/TripPin/7-AdvancedSchema/Table.GenerateByPage.pqm: -------------------------------------------------------------------------------- 1 | (getNextPage as function) as table => 2 | let 3 | listOfPages = List.Generate( 4 | // get the first page of data 5 | () => getNextPage(null), 6 | // stop when the function returns null 7 | (lastPage) => lastPage <> null, 8 | // pass the previous page to the next function call 9 | (lastPage) => getNextPage(lastPage) 10 | ), 11 | // concatenate the pages together 12 | tableOfPages = Table.FromList(listOfPages, Splitter.SplitByNothing(), {"Column1"}), 13 | firstRow = tableOfPages{0} ? 14 | in 15 | // if we didn't get back any pages of data, return an empty table 16 | // otherwise set the table type based on the columns of the first page 17 | if (firstRow = null) then 18 | Table.FromRows({}) 19 | // check for empty first table 20 | else if (Table.IsEmpty(firstRow[Column1])) then 21 | firstRow[Column1] 22 | else 23 | Value.ReplaceType( 24 | Table.ExpandTableColumn(tableOfPages, "Column1", Table.ColumnNames(firstRow[Column1])), 25 | Value.Type(firstRow[Column1]) 26 | ) 27 | -------------------------------------------------------------------------------- /samples/TripPin/7-AdvancedSchema/Table.ToNavigationTable.pqm: -------------------------------------------------------------------------------- 1 | ( 2 | table as table, 3 | keyColumns as list, 4 | nameColumn as text, 5 | dataColumn as text, 6 | itemKindColumn as text, 7 | itemNameColumn as text, 8 | isLeafColumn as text 9 | ) as table => 10 | let 11 | tableType = Value.Type(table), 12 | newTableType = Type.AddTableKey(tableType, keyColumns, true) meta [ 13 | NavigationTable.NameColumn = nameColumn, 14 | NavigationTable.DataColumn = dataColumn, 15 | NavigationTable.ItemKindColumn = itemKindColumn, 16 | Preview.DelayColumn = itemNameColumn, 17 | NavigationTable.IsLeafColumn = isLeafColumn 18 | ], 19 | navigationTable = Value.ReplaceType(table, newTableType) 20 | in 21 | navigationTable 22 | -------------------------------------------------------------------------------- /samples/TripPin/7-AdvancedSchema/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/8-Diagnostics/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/8-Diagnostics/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 8 - Adding Diagnostics 2 | 3 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially - each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 4 | 5 | In this lesson, you will: 6 | 7 | * Learn about the [Diagnostics.Trace](https://msdn.microsoft.com/query-bi/m/diagnostics-trace) function 8 | * Use the Diagnostics helper functions to add trace information to help debug your connector 9 | 10 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/8-diagnostics/readme). 11 | -------------------------------------------------------------------------------- /samples/TripPin/8-Diagnostics/Table.GenerateByPage.pqm: -------------------------------------------------------------------------------- 1 | (getNextPage as function) as table => 2 | let 3 | listOfPages = List.Generate( 4 | // get the first page of data 5 | () => getNextPage(null), 6 | // stop when the function returns null 7 | (lastPage) => lastPage <> null, 8 | // pass the previous page to the next function call 9 | (lastPage) => getNextPage(lastPage) 10 | ), 11 | // concatenate the pages together 12 | tableOfPages = Table.FromList(listOfPages, Splitter.SplitByNothing(), {"Column1"}), 13 | firstRow = tableOfPages{0} ? 14 | in 15 | // if we didn't get back any pages of data, return an empty table 16 | // otherwise set the table type based on the columns of the first page 17 | if (firstRow = null) then 18 | Table.FromRows({}) 19 | // check for empty first table 20 | else if (Table.IsEmpty(firstRow[Column1])) then 21 | firstRow[Column1] 22 | else 23 | Value.ReplaceType( 24 | Table.ExpandTableColumn(tableOfPages, "Column1", Table.ColumnNames(firstRow[Column1])), 25 | Value.Type(firstRow[Column1]) 26 | ) 27 | -------------------------------------------------------------------------------- /samples/TripPin/8-Diagnostics/Table.ToNavigationTable.pqm: -------------------------------------------------------------------------------- 1 | ( 2 | table as table, 3 | keyColumns as list, 4 | nameColumn as text, 5 | dataColumn as text, 6 | itemKindColumn as text, 7 | itemNameColumn as text, 8 | isLeafColumn as text 9 | ) as table => 10 | let 11 | tableType = Value.Type(table), 12 | newTableType = Type.AddTableKey(tableType, keyColumns, true) meta [ 13 | NavigationTable.NameColumn = nameColumn, 14 | NavigationTable.DataColumn = dataColumn, 15 | NavigationTable.ItemKindColumn = itemKindColumn, 16 | Preview.DelayColumn = itemNameColumn, 17 | NavigationTable.IsLeafColumn = isLeafColumn 18 | ], 19 | navigationTable = Value.ReplaceType(table, newTableType) 20 | in 21 | navigationTable 22 | -------------------------------------------------------------------------------- /samples/TripPin/8-Diagnostics/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/9-TestConnection/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\TripPin.mez", 3 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\TripPin.query.pq", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/TripPin/9-TestConnection/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Part 9 - TestConnection 2 | 3 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially - each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 4 | 5 | In this lesson, you will: 6 | 7 | * Add a TestConnection handler 8 | * Configure the Power BI On-Premises Data Gateway (Personal mode) 9 | * Test scheduled refresh through the Power BI service 10 | 11 | Please follow the tutorial at Microsoft Docs for Power Query [here](https://docs.microsoft.com/en-us/power-query/samples/trippin/9-testconnection/readme). 12 | -------------------------------------------------------------------------------- /samples/TripPin/9-TestConnection/Table.GenerateByPage.pqm: -------------------------------------------------------------------------------- 1 | (getNextPage as function) as table => 2 | let 3 | listOfPages = List.Generate( 4 | // get the first page of data 5 | () => getNextPage(null), 6 | // stop when the function returns null 7 | (lastPage) => lastPage <> null, 8 | // pass the previous page to the next function call 9 | (lastPage) => getNextPage(lastPage) 10 | ), 11 | // concatenate the pages together 12 | tableOfPages = Table.FromList(listOfPages, Splitter.SplitByNothing(), {"Column1"}), 13 | firstRow = tableOfPages{0} ? 14 | in 15 | // if we didn't get back any pages of data, return an empty table 16 | // otherwise set the table type based on the columns of the first page 17 | if (firstRow = null) then 18 | Table.FromRows({}) 19 | // check for empty first table 20 | else if (Table.IsEmpty(firstRow[Column1])) then 21 | firstRow[Column1] 22 | else 23 | Value.ReplaceType( 24 | Table.ExpandTableColumn(tableOfPages, "Column1", Table.ColumnNames(firstRow[Column1])), 25 | Value.Type(firstRow[Column1]) 26 | ) 27 | -------------------------------------------------------------------------------- /samples/TripPin/9-TestConnection/Table.ToNavigationTable.pqm: -------------------------------------------------------------------------------- 1 | ( 2 | table as table, 3 | keyColumns as list, 4 | nameColumn as text, 5 | dataColumn as text, 6 | itemKindColumn as text, 7 | itemNameColumn as text, 8 | isLeafColumn as text 9 | ) as table => 10 | let 11 | tableType = Value.Type(table), 12 | newTableType = Type.AddTableKey(tableType, keyColumns, true) meta [ 13 | NavigationTable.NameColumn = nameColumn, 14 | NavigationTable.DataColumn = dataColumn, 15 | NavigationTable.ItemKindColumn = itemKindColumn, 16 | Preview.DelayColumn = itemNameColumn, 17 | NavigationTable.IsLeafColumn = isLeafColumn 18 | ], 19 | navigationTable = Value.ReplaceType(table, newTableType) 20 | in 21 | navigationTable 22 | -------------------------------------------------------------------------------- /samples/TripPin/9-TestConnection/TripPin.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TripPin 5 | 6 | 7 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 8 | $(MSBuildProjectDirectory)\obj\ 9 | $(IntermediateOutputPath)MEZ\ 10 | $(OutputPath)$(ConnectorName).mez 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/TripPin/README.md: -------------------------------------------------------------------------------- 1 | # TripPin Tutorial 2 | 3 | This multi-part tutorial covers the creation of a new data source extension for Power Query. The tutorial is meant to be done sequentially - each lesson builds on the connector created in previous lessons, incrementally adding new capabilities to your connector. 4 | 5 | This tutorial uses a public [OData](http://www.odata.org/documentation/) service ([TripPin](http://services.odata.org/v4/TripPinService/)) as a reference source. Although this lesson requires the use of the M engine's OData functions, subsequent lessons will use [Web.Contents](https://msdn.microsoft.com/en-us/library/mt260892.aspx), making it applicable to (most) REST APIs. 6 | 7 | ## Prerequisites 8 | 9 | The following applications will be used throughout this tutorial: 10 | 11 | * [Power BI Desktop](https://www.microsoft.com/en-us/download/details.aspx?id=45331), May 2017 release or later 12 | * [Power Query SDK for Visual Studio](https://aka.ms/powerquerysdk) 13 | * [Fiddler](http://www.telerik.com/fiddler) - Optional, but recommended for viewing and debugging requests to your REST service 14 | 15 | Reviewing the [M Extensibility documentation](../../docs/m-extensions.md) before starting this tutorial is highly recommended. 16 | 17 | ## Parts 18 | 19 | |Part|Lesson |Details| 20 | |----|:------------------------------------|:----------------------------------------------------| 21 | |1 |[OData](1-OData) |Create a simple Data Connector over an OData service | 22 | |2 |[Rest](2-Rest) |Connect to a REST API that returns a JSON response | 23 | |3 |[Nav Tables](3-NavTables) |Providing a navigation experience for your source | 24 | |4 |[Data Source Paths](4-Paths) |How credentials are identified for your data source | 25 | |5 |[Paging](5-Paging) |Read with a paged response from a web service | 26 | |6 |[Enforcing Schema](6-Schema) |Enforce table structure and column data types | 27 | |7 |[Advanced Schema](7-AdvancedSchema) |Dynamically enforce table structure using M types and external metadata | 28 | |8 |[Diagnostics](8-Diagnostics) |Add detailed tracing to the connector | 29 | |9 |[Test Connection](9-TestConnection) |Implement a TestConnection handler to enable refresh through the gateway | 30 | |10 |[Query Folding (part 1)](10-TableView1)|Implement basic query folding handlers | 31 | -------------------------------------------------------------------------------- /samples/UnitTesting/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "powerquery.sdk.defaultQueryFile": "${workspaceFolder}\\${workspaceFolderBasename}.query.pq", 3 | "powerquery.sdk.defaultExtension": "${workspaceFolder}\\bin\\AnyCPU\\Debug\\${workspaceFolderBasename}.mez", 4 | "powerquery.general.mode": "SDK", 5 | } -------------------------------------------------------------------------------- /samples/UnitTesting/README.md: -------------------------------------------------------------------------------- 1 | # Unit Testing Sample 2 | 3 | This sample shows how you can add simple unit testing to your `.query.pq file`. 4 | 5 | Please see [Handling Unit Testing](https://docs.microsoft.com/en-us/power-query/handlingunittesting) in the PQ Docs for a full write up. 6 | -------------------------------------------------------------------------------- /samples/UnitTesting/UnitTesting.pq: -------------------------------------------------------------------------------- 1 | section UnitTesting; 2 | 3 | shared UnitTesting.ReturnsABC = () => "ABC"; 4 | shared UnitTesting.Returns123 = () => "123"; 5 | shared UnitTesting.ReturnsTableWithFiveRows = () => Table.Repeat(#table({"a"}, {{1}}), 5); 6 | -------------------------------------------------------------------------------- /samples/UnitTesting/UnitTesting.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildProjectDirectory)\bin\AnyCPU\Debug\ 5 | $(MSBuildProjectDirectory)\obj\ 6 | $(IntermediateOutputPath)MEZ\ 7 | $(OutputPath)$(MsBuildProjectName).mez 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/dirs.proj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /samples/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "msbuild-sdks": { 3 | "Microsoft.Build.NoTargets": "2.0.1", 4 | "Microsoft.Build.Traversal": "3.0.2" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /testframework/data/PQSDKTestData.md: -------------------------------------------------------------------------------- 1 | # PQ SDK Test Framework - Test Data 2 | 3 | The test data used for PQ SDK Test framework is a modified version of the **Taxi & Limousine Comission (TLC) green trip 4 | record data** and the **Taxi Zone Lookup table**. The details of the data could be found on the 5 | [TLC Trip Record Data](https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page) page on the NYC Taxi & Limousine 6 | Commission website. 7 | 8 | The modified dataset is open for anyone to use under the [CDLA-Permissive-2.0 license](https://cdla.dev/permissive-2-0/). 9 | 10 | ## PQ SDK Test Framework - Test Data Details: 11 | 12 | The PQ SDK Test Framework dataset contains the below files: 13 | 14 | - **nyc_taxi_tripdata.csv** file which contains 10000 rows sampled from the February 2023 green trip data 15 | - **taxi+\_zone_lookup.csv** file which contains 265 rows from the taxi zone lookup table 16 | - **PQSDKTestFrameworkDataSchema.sql** file contains the schema for NyxTaxiGreen and TaxiZoneLookup table 17 | 18 | ## PQ SDK Test Framework - Test Data Loading 19 | 20 | The PQ SDK Test Framework dataset needs to be loaded to the datasource for your extension connector before running the 21 | PQ SDK Testframework Test Suites. The data is provided in convenient csv format so that it can be easily be loaded to 22 | any datasource. The **nyc_taxi_tripdata.csv** and **taxi+\_zone_lookup.csv** files should be respectively loaded into 23 | NyxTaxiGreen and TaxiZoneLookup tables as per the schema specified in the **PQSDKTestFrameworkDataSchema.sql** file. 24 | -------------------------------------------------------------------------------- /testframework/data/PQSDKTestFrameworkDataSchema.sql: -------------------------------------------------------------------------------- 1 | /* 2 | NOTE: 3 | 1) While uploading to the data source, all decimal values should have a scale of 2. That is, the number of digits after the decimal point should be 2. 4 | 2) All timestamp values should be uploaded to the datasouce in MM/DD/YYYY HH24:MI:SS format. 5 | */ 6 | 7 | CREATE TABLE NycTaxiGreen ( 8 | RecordID int, 9 | VendorID int, 10 | lpepPickupDatetime timestamp, 11 | lpepDropoffDatetime timestamp, 12 | storeAndFwdFlag boolean, 13 | RateCodeID int, 14 | PULocationID int, 15 | DOLocationID int, 16 | passenger_count int, 17 | trip_distance double, 18 | fare_amount double, 19 | extra double, 20 | mta_tax double, 21 | tip_amount double, 22 | tolls_amount double, 23 | improvement_surcharge double, 24 | total_amount double, 25 | payment_type int, 26 | trip_type int, 27 | congestion_surcharge double 28 | ); 29 | 30 | CREATE TABLE TaxiZoneLookup ( 31 | LocationId int, 32 | Borough string, 33 | Zone string, 34 | service_zone string 35 | ); 36 | -------------------------------------------------------------------------------- /testframework/tests/ConnectorConfigs/generic/ParameterQueries/Generic.parameterquery.pq: -------------------------------------------------------------------------------- 1 | Replace with the M query to connect to your data source and retrieve the NycTaxiGreen & TaxiZoneLookup Table 2 | 3 | // Example: 4 | // let 5 | // Source = Sql.Database("your_server_name", "your_dabase_name"), 6 | // NycTaxiGreen_Table = Source{[Schema="your_schema_name",Item="NycTaxiGreen"]}[Data], 7 | // TaxiZoneLookup_Table = Source{[Schema="your_schema_name",Item="TaxiZoneLookup"]}[Data] 8 | // in 9 | // [taxi_table = NycTaxiGreen_Table, zone_table = TaxiZoneLookup_Table] -------------------------------------------------------------------------------- /testframework/tests/ConnectorConfigs/generic/Settings/SanitySettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "FailOnMissingOutputFile": false, 3 | "QueryFilePath": "TestSuites/Sanity", 4 | "ParameterQueryFilePath": "ConnectorConfigs/Generic/ParameterQueries/Generic.parameterquery.pq" 5 | } 6 | -------------------------------------------------------------------------------- /testframework/tests/ConnectorConfigs/generic/Settings/StandardSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "FailOnMissingOutputFile": false, 3 | "QueryFilePath": "TestSuites/Standard", 4 | "ParameterQueryFilePath": "ConnectorConfigs/Generic/ParameterQueries/Generic.parameterquery.pq" 5 | } 6 | -------------------------------------------------------------------------------- /testframework/tests/RunPQSDKTestSuitesSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "PQTestExePath":"", 3 | "ExtensionPath":"" 4 | } -------------------------------------------------------------------------------- /testframework/tests/RunPQSDKTestSuitesSettingsTemplate.json: -------------------------------------------------------------------------------- 1 | { 2 | "PQTestExePath":"", 3 | "ExtensionPath":"", 4 | "TestSettingsDirectoryPath":"", 5 | "TestSettingsList":"", 6 | "ValidateQueryFolding":"", 7 | "DetailedResults":"", 8 | "JSONResults":"" 9 | } -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Taxi/AllTypes.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sort = Table.Sort(parameter[taxi_table], {"RecordID"}) 4 | in 5 | Sort -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Taxi/AllTypesRowCount.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sort = Table.Sort(parameter[taxi_table], {"RecordID"}), 4 | RowCount = Table.RowCount(Sort) 5 | in 6 | if (RowCount <> 10000) then 7 | error "Expected 10000 rows in the NycTaxiGreen table but found " & Number.ToText(RowCount) & " rows." 8 | else 9 | RowCount -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Taxi/AllTypesRowCount.query.pqout: -------------------------------------------------------------------------------- 1 | 10000 -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Taxi/AllTypesSchema.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | EnsureLocal = Table.StopFolding(parameter[taxi_table]), 4 | Schema = Table.Schema(EnsureLocal), 5 | SelectColumns = Table.SelectColumns(Schema,{"Name", "Kind", "IsNullable"}), 6 | Sort = Table.Sort(SelectColumns,{{"Name", Order.Ascending}}) 7 | in 8 | Sort 9 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Taxi/AllTypesSchema.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Name = text, Kind = text, IsNullable = logical] , {{"DOLocationID", "number", true} , {"PULocationID", "number", true} , {"RatecodeID", "number", true} , {"RecordID", "number", true} , {"VendorID", "number", true} , {"congestion_surcharge", "number", true} , {"extra", "number", true} , {"fare_amount", "number", true} , {"improvement_surcharge", "number", true} , {"lpep_dropoff_datetime", "datetime", true} , {"lpep_pickup_datetime", "datetime", true} , {"mta_tax", "number", true} , {"passenger_count", "number", true} , {"payment_type", "number", true} , {"store_and_fwd_flag", "logical", true} , {"tip_amount", "number", true} , {"tolls_amount", "number", true} , {"total_amount", "number", true} , {"trip_distance", "number", true} , {"trip_type", "number", true} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Zone/AllTypesZone.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sort = Table.Sort(parameter[zone_table], {"LocationID"}) 4 | in 5 | Sort -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Zone/AllTypesZoneRowCount.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sort = Table.Sort(parameter[zone_table], {"LocationID"}), 4 | RowCount = Table.RowCount(Sort) 5 | in 6 | if (RowCount <> 265) then 7 | error "Expected 265 rows in the TaxiZoneLookup table but found " & Number.ToText(RowCount) & " rows." 8 | else 9 | RowCount -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Zone/AllTypesZoneRowCount.query.pqout: -------------------------------------------------------------------------------- 1 | 265 -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Zone/AllTypesZoneSchema.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | EnsureLocal = Table.StopFolding(parameter[zone_table]), 4 | Schema = Table.Schema(EnsureLocal), 5 | SelectColumns = Table.SelectColumns(Schema,{"Name", "Kind", "IsNullable"}), 6 | Sort = Table.Sort(SelectColumns,{{"Name", Order.Ascending}}) 7 | in 8 | Sort 9 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Sanity/Zone/AllTypesZoneSchema.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Name = text, Kind = text, IsNullable = logical] , {{"Borough", "text", true} , {"LocationID", "number", true} , {"Zone", "text", true} , {"service_zone", "text", true} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/AddColumnSpecialCharacters.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectRows = Table.AddColumn(parameter[taxi_table], "Column", each "#(lf)#(tab)#(0000)"), 4 | SelectColumns = Table.SelectColumns(SelectRows, { "Column" }), 5 | FirstN = Table.FirstN(SelectColumns, 1) 6 | in 7 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/AddColumnSpecialCharacters.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Column = any] , {{"#(lf)#(tab)#(0000)"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/AllTypesNativeQuery.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, VendorID = number, lpep_pickup_datetime = datetime, lpep_dropoff_datetime = datetime, store_and_fwd_flag = logical, RatecodeID = number, PULocationID = number, DOLocationID = number, passenger_count = number, trip_distance = number, fare_amount = number, extra = number, mta_tax = number, tip_amount = number, tolls_amount = number, improvement_surcharge = number, total_amount = number, payment_type = number, trip_type = number, congestion_surcharge = number] , {{4, 2, #datetime(2023, 2, 1, 0, 15, 0), #datetime(2023, 2, 1, 0, 26, 0), false, 1, 82, 223, 1, 3.14, 17, 1, 0.5, 0, 0, 1, 19.5, 2, 1, 0} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/AlltypesNativeQuery.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sort = Table.Sort(parameter[taxi_table], {"RecordID"}), 4 | FirstN = Table.FirstN(Sort, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/Cast.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[taxi_table], {"RecordID"}), 4 | Columns = [ 5 | TimestampToDateCast = each Date.From([lpep_pickup_datetime]), 6 | TimestampToStringCast = each Text.From([lpep_dropoff_datetime],"en-US"), 7 | FloatToIntegerCast = each Int64.From([trip_distance]), 8 | FloatToStringCast = each Text.From(Number.Round([fare_amount], 2)), 9 | IntegerToFloatCast = each Double.From([PULocationID]), 10 | IntegerToStringCast = each Text.From([passenger_count]), 11 | BooleanToStringCast = each Text.From([store_and_fwd_flag]) 12 | ], 13 | AddColumns = List.Accumulate(Record.FieldNames(Columns), Sorted, 14 | (state, current) => Table.AddColumn(state, current, Record.Field(Columns, current))), 15 | SelectRows = Table.SelectRows(AddColumns, each [PULocationID] = 75), 16 | SelectColumns = Table.SelectColumns(SelectRows, Record.FieldNames(Columns)), 17 | FirstN = Table.FirstN(SelectColumns, 1) 18 | in 19 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/Cast.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [TimestampToDateCast = any, TimestampToStringCast = any, FloatToIntegerCast = any, FloatToStringCast = any, IntegerToFloatCast = any, IntegerToStringCast = any, BooleanToStringCast = any] , {{#date(2023, 2, 1), "2/1/2023 12:49:00 AM", 1, "8.6", 75, "1", "false"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/FirstEntry.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sort = Table.Sort(parameter[taxi_table], {"RecordID"}), 4 | FirstN = Table.FirstN(Sort, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/FirstEntry.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, VendorID = number, lpep_pickup_datetime = datetime, lpep_dropoff_datetime = datetime, store_and_fwd_flag = logical, RatecodeID = number, PULocationID = number, DOLocationID = number, passenger_count = number, trip_distance = number, fare_amount = number, extra = number, mta_tax = number, tip_amount = number, tolls_amount = number, improvement_surcharge = number, total_amount = number, payment_type = number, trip_type = number, congestion_surcharge = number] , {{4, 2, #datetime(2023, 2, 1, 0, 15, 0), #datetime(2023, 2, 1, 0, 26, 0), false, 1, 82, 223, 1, 3.14, 17, 1, 0.5, 0, 0, 1, 19.5, 2, 1, 0} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/IfBoolean.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | AddColumns = Table.AddColumn(parameter[taxi_table], "Column", each if [store_and_fwd_flag] = true then true else false), 4 | SelectColumns = Table.SelectColumns(AddColumns, { "Column" }), 5 | SelectRows = Table.SelectRows(SelectColumns, each [Column] = false), 6 | Sort = Table.Sort(SelectRows, each [Column]), 7 | FirstN = Table.FirstN(Sort, 1){0} 8 | in 9 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/IfBoolean.query.pqout: -------------------------------------------------------------------------------- 1 | [ Column = false ] -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/MultiplyColumnsOfDifferenttypes.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | AddColumns = Table.AddColumn(parameter[taxi_table], "Custom", each Number.Round(([payment_type] * [fare_amount]), 2)), 4 | SelectColumns = Table.SelectColumns(AddColumns, { "lpep_pickup_datetime", "Custom" }), 5 | Sort = Table.Sort(SelectColumns, { { "lpep_pickup_datetime", Order.Ascending } }), 6 | FirstN = Table.FirstN(Sort, 2) 7 | in 8 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/MultiplyColumnsOfDifferenttypes.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [lpep_pickup_datetime = datetime, Custom = any] , {{#datetime(2023, 1, 25, 21, 9, 0), 22.6} , {#datetime(2023, 1, 26, 19, 59, 0), 18} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/NullableEquals.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.SelectColumns(parameter[taxi_table], {"total_amount","payment_type"}), 4 | T3 = Table.AddColumn(T2, "PaymentTypeIsEmpty", each Value.NullableEquals([payment_type],4)), 5 | T4 = Table.Sort(T3, "total_amount"), 6 | T5 = Table.FirstN(T4,5) 7 | in 8 | T5 -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/NullableEquals.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [total_amount = number, payment_type = number, PaymentTypeIsEmpty = any] , {{-94.84, null, null} , {-41.00, 4, true} , {-21.00, 4, true} , {-17.75, 4, true} , {-9.80, 3, false} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/SelectRowsBoolColumn.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectRows = Table.SelectRows(parameter[taxi_table], each [store_and_fwd_flag] = true), 4 | SelectColumns = Table.SelectColumns(SelectRows, { "lpep_dropoff_datetime", "DOLocationID" }), 5 | Sort = Table.Sort(SelectColumns, {"DOLocationID"}), 6 | FirstN = Table.FirstN(Sort, 2) 7 | in 8 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/SelectRowsBoolColumn.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [lpep_dropoff_datetime = datetime, DOLocationID = number] , {{#datetime(2023, 2, 23, 23, 55, 0), 14} , {#datetime(2023, 2, 13, 18, 16, 0), 24} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/SkipTake.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | GetResult = (transform) => 4 | let 5 | Transformed = transform(parameter[taxi_table]), 6 | RowCount = Table.RowCount(Transformed) 7 | in 8 | RowCount 9 | in 10 | [ 11 | NoSkipTake = GetResult((table) => table), 12 | FirstN = GetResult((table) => Table.FirstN(table, 1)), 13 | Skip = GetResult((table) => Table.Skip(table, 2199)), 14 | FirstNSkip = GetResult((table) => Table.FirstN(Table.Skip(table, 2198), 1)) 15 | ] -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/SkipTake.query.pqout: -------------------------------------------------------------------------------- 1 | [ NoSkipTake = 10000, FirstN = 1, Skip = 7801, FirstNSkip = 1 ] -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/Sort.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | ColumnNames = { "VendorID", "lpep_pickup_datetime", "store_and_fwd_flag", "trip_distance" }, 4 | Tests = List.Accumulate(ColumnNames, [], (state, current) => 5 | let 6 | Result = 7 | let 8 | Sort = Table.Sort(parameter[taxi_table], current), 9 | RowCount = Table.RowCount(Sort) 10 | in 11 | RowCount, 12 | AddField = Record.AddField(state, current, Result) 13 | in 14 | AddField) 15 | in 16 | Tests -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/Sort.query.pqout: -------------------------------------------------------------------------------- 1 | [ VendorID = 10000, lpep_pickup_datetime = 10000, store_and_fwd_flag = 10000, trip_distance = 10000 ] -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/SortDatetime.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.SelectColumns(parameter[taxi_table], { "lpep_dropoff_datetime" }), 4 | Sort = Table.Sort(SelectColumns, {{(t1008) => if t1008[lpep_dropoff_datetime] <> null then t1008[lpep_dropoff_datetime] else DateTime.From(- 2), Order.Ascending}, {(t1009) => if t1009[lpep_dropoff_datetime] = null then 0 else 1, Order.Ascending}}) 5 | in 6 | Sort -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Datatypes/SortTimestamp.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.SelectColumns(parameter[taxi_table], { "lpep_dropoff_datetime" }), 4 | Sort = Table.Sort(SelectColumns, {{(t1008) => if t1008[lpep_dropoff_datetime] <> null then t1008[lpep_dropoff_datetime] else DateTime.From(- 2), Order.Ascending}, {(t1009) => if t1009[lpep_dropoff_datetime] = null then 0 else 1, Order.Ascending}}) 5 | in 6 | Sort 7 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFilter_QueryFolding.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T1 = Table.SelectRows(parameter[taxi_table], each ([PULocationID] = 75 or [DOLocationID] = 170) and (DateTime.Date([lpep_pickup_datetime]) = #date(2023, 2, 23))), 4 | T2 = Table.SelectColumns(T1,{"RecordID", "lpep_pickup_datetime", "lpep_dropoff_datetime", "PULocationID", "DOLocationID"}), 5 | T3 = Table.Sort(T2, {"RecordID"}) 6 | in 7 | T3 -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Date_1.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.SelectColumns(parameter[taxi_table], {"RecordID","lpep_pickup_datetime"}), 4 | T3 = Table.Sort(T2, {"RecordID"}), 5 | T4 = Table.AddColumn(T3, "Y", each Date.Year([lpep_pickup_datetime])), 6 | T5 = Table.AddColumn(T4, "M", each Date.Month([lpep_pickup_datetime])), 7 | T6 = Table.AddColumn(T5, "D", each Date.Day([lpep_pickup_datetime])), 8 | T7 = Table.AddColumn(T6, "QOY", each Date.QuarterOfYear([lpep_pickup_datetime])), 9 | T8 = Table.AddColumn(T7, "WOY", each Date.WeekOfYear([lpep_pickup_datetime])), 10 | T9 = Table.AddColumn(T8, "DOY", each Date.DayOfYear([lpep_pickup_datetime])), 11 | TA = Table.FirstN(T9, 4) 12 | in 13 | TA -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Date_1.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, lpep_pickup_datetime = datetime, Y = any, M = any, D = any, QOY = any, WOY = any, DOY = any] , {{4, #datetime(2023, 2, 1, 0, 15, 0), 2023, 2, 1, 1, 5, 32} , {8, #datetime(2023, 2, 1, 0, 43, 0), 2023, 2, 1, 1, 5, 32} , {15, #datetime(2023, 2, 1, 0, 9, 0), 2023, 2, 1, 1, 5, 32} , {16, #datetime(2023, 2, 1, 0, 42, 0), 2023, 2, 1, 1, 5, 32} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Date_2.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.SelectColumns(parameter[taxi_table], {"RecordID","lpep_pickup_datetime"}), 4 | T3 = Table.Sort(T2, {"RecordID"}), 5 | T4 = Table.AddColumn(T3, "SOY", each DateTime.ToText(Date.StartOfYear([lpep_pickup_datetime]))), 6 | T5 = Table.AddColumn(T4, "SOQ", each DateTime.ToText(Date.StartOfQuarter([lpep_pickup_datetime]))), 7 | T6 = Table.AddColumn(T5, "SOM", each DateTime.ToText(Date.StartOfMonth([lpep_pickup_datetime]))), 8 | T7 = Table.AddColumn(T6, "SOW", each DateTime.ToText(Date.StartOfWeek([lpep_pickup_datetime]))), 9 | T8 = Table.AddColumn(T7, "SOD", each DateTime.ToText(Date.StartOfDay([lpep_pickup_datetime]))), 10 | T9 = Table.AddColumn(T8, "EOY", each DateTime.ToText(Date.EndOfYear([lpep_pickup_datetime]))), 11 | TA = Table.AddColumn(T9, "EOQ", each DateTime.ToText(Date.EndOfQuarter([lpep_pickup_datetime]))), 12 | TB = Table.AddColumn(TA, "EOM", each DateTime.ToText(DateTime.From(Date.EndOfMonth([lpep_pickup_datetime])))), 13 | TC = Table.AddColumn(TB, "EOW", each DateTime.ToText(Date.EndOfWeek([lpep_pickup_datetime]))), 14 | TD = Table.AddColumn(TC, "EOD", each DateTime.ToText(Date.EndOfDay([lpep_pickup_datetime]))), 15 | TE = Table.FirstN(TD, 4) 16 | in 17 | TE -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Date_2.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, lpep_pickup_datetime = datetime, SOY = any, SOQ = any, SOM = any, SOW = any, SOD = any, EOY = any, EOQ = any, EOM = any, EOW = any, EOD = any] , {{4, #datetime(2023, 2, 1, 0, 15, 0), "1/1/2023 12:00:00 AM", "1/1/2023 12:00:00 AM", "2/1/2023 12:00:00 AM", "1/29/2023 12:00:00 AM", "2/1/2023 12:00:00 AM", "12/31/2023 11:59:59 PM", "3/31/2023 11:59:59 PM", "2/28/2023 11:59:59 PM", "2/4/2023 11:59:59 PM", "2/1/2023 11:59:59 PM"} , {8, #datetime(2023, 2, 1, 0, 43, 0), "1/1/2023 12:00:00 AM", "1/1/2023 12:00:00 AM", "2/1/2023 12:00:00 AM", "1/29/2023 12:00:00 AM", "2/1/2023 12:00:00 AM", "12/31/2023 11:59:59 PM", "3/31/2023 11:59:59 PM", "2/28/2023 11:59:59 PM", "2/4/2023 11:59:59 PM", "2/1/2023 11:59:59 PM"} , {15, #datetime(2023, 2, 1, 0, 9, 0), "1/1/2023 12:00:00 AM", "1/1/2023 12:00:00 AM", "2/1/2023 12:00:00 AM", "1/29/2023 12:00:00 AM", "2/1/2023 12:00:00 AM", "12/31/2023 11:59:59 PM", "3/31/2023 11:59:59 PM", "2/28/2023 11:59:59 PM", "2/4/2023 11:59:59 PM", "2/1/2023 11:59:59 PM"} , {16, #datetime(2023, 2, 1, 0, 42, 0), "1/1/2023 12:00:00 AM", "1/1/2023 12:00:00 AM", "2/1/2023 12:00:00 AM", "1/29/2023 12:00:00 AM", "2/1/2023 12:00:00 AM", "12/31/2023 11:59:59 PM", "3/31/2023 11:59:59 PM", "2/28/2023 11:59:59 PM", "2/4/2023 11:59:59 PM", "2/1/2023 11:59:59 PM"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Date_3.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[taxi_table], {"RecordID"}), 4 | Columns = [ 5 | AddDays = each Date.AddDays([lpep_pickup_datetime], 2), 6 | SubDays = each Date.AddDays([lpep_pickup_datetime], -2), 7 | AddYears = each Date.AddYears([lpep_pickup_datetime], 2), 8 | SubYears = each Date.AddYears([lpep_pickup_datetime], -2), 9 | AddMonths = each Date.AddMonths([lpep_pickup_datetime], 2), 10 | SubMonths = each Date.AddMonths([lpep_pickup_datetime], -2), 11 | AddQuarter = each Date.AddQuarters([lpep_pickup_datetime], 2), 12 | SubQuarter = each Date.AddQuarters([lpep_pickup_datetime], -2), 13 | AddWeeks = each Date.AddWeeks([lpep_pickup_datetime], 2), 14 | SubWeeks = each Date.AddWeeks([lpep_pickup_datetime], -2) 15 | ], 16 | AddColumns = List.Accumulate(Record.FieldNames(Columns), Sorted, 17 | (state, current) => Table.AddColumn(state, current, Record.Field(Columns, current))), 18 | SelectRows = Table.SelectRows(AddColumns, each [PULocationID] = 75), 19 | SelectColumns = Table.SelectColumns(SelectRows, Record.FieldNames(Columns)), 20 | FirstN = Table.FirstN(SelectColumns, 1) 21 | in 22 | FirstN 23 | 24 | // To Do: This test fails for BigQuery as the time is ignored for date operations. -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Date_3.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [AddDays = any, SubDays = any, AddYears = any, SubYears = any, AddMonths = any, SubMonths = any, AddQuarter = any, SubQuarter = any, AddWeeks = any, SubWeeks = any] , {{#datetime(2023, 2, 3, 0, 43, 0), #datetime(2023, 1, 30, 0, 43, 0), #datetime(2025, 2, 1, 0, 43, 0), #datetime(2021, 2, 1, 0, 43, 0), #datetime(2023, 4, 1, 0, 43, 0), #datetime(2022, 12, 1, 0, 43, 0), #datetime(2023, 8, 1, 0, 43, 0), #datetime(2022, 8, 1, 0, 43, 0), #datetime(2023, 2, 15, 0, 43, 0), #datetime(2023, 1, 18, 0, 43, 0)} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_1.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.SelectColumns(parameter[taxi_table], {"RecordID","lpep_dropoff_datetime"}), 4 | T3 = Table.Sort(T2, {"RecordID"}), 5 | T4 = Table.AddColumn(T3, "Y", each Date.Year([lpep_dropoff_datetime])), 6 | T5 = Table.AddColumn(T4, "M", each Date.Month([lpep_dropoff_datetime])), 7 | T6 = Table.AddColumn(T5, "D", each Date.Day([lpep_dropoff_datetime])), 8 | T7 = Table.AddColumn(T6, "QOY", each Date.QuarterOfYear([lpep_dropoff_datetime])), 9 | T8 = Table.AddColumn(T7, "WOY", each Date.WeekOfYear([lpep_dropoff_datetime])), 10 | T9 = Table.AddColumn(T8, "DOY", each Date.DayOfYear([lpep_dropoff_datetime])), 11 | TA = Table.FirstN(T9, 4) 12 | in 13 | TA -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_1.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, lpep_dropoff_datetime = datetime, Y = any, M = any, D = any, QOY = any, WOY = any, DOY = any] , {{4, #datetime(2023, 2, 1, 0, 26, 0), 2023, 2, 1, 1, 5, 32} , {8, #datetime(2023, 2, 1, 0, 49, 0), 2023, 2, 1, 1, 5, 32} , {15, #datetime(2023, 2, 1, 0, 10, 0), 2023, 2, 1, 1, 5, 32} , {16, #datetime(2023, 2, 1, 0, 56, 0), 2023, 2, 1, 1, 5, 32} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_2a.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.SelectColumns(parameter[taxi_table], {"RecordID","lpep_dropoff_datetime"}), 4 | T3 = Table.Sort(T2, {"RecordID"}), 5 | T4 = Table.AddColumn(T3, "SOY", each Date.StartOfYear([lpep_dropoff_datetime])), 6 | T5 = Table.AddColumn(T4, "SOQ", each Date.StartOfQuarter([lpep_dropoff_datetime])), 7 | T6 = Table.AddColumn(T5, "SOM", each Date.StartOfMonth([lpep_dropoff_datetime])), 8 | T7 = Table.AddColumn(T6, "SOD", each Date.StartOfDay([lpep_dropoff_datetime])), 9 | T8 = Table.FirstN(T7, 4) 10 | in 11 | T8 -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_2a.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, lpep_dropoff_datetime = datetime, SOY = any, SOQ = any, SOM = any, SOD = any] , {{4, #datetime(2023, 2, 1, 0, 26, 0), #datetime(2023, 1, 1, 0, 0, 0), #datetime(2023, 1, 1, 0, 0, 0), #datetime(2023, 2, 1, 0, 0, 0), #datetime(2023, 2, 1, 0, 0, 0)} , {8, #datetime(2023, 2, 1, 0, 49, 0), #datetime(2023, 1, 1, 0, 0, 0), #datetime(2023, 1, 1, 0, 0, 0), #datetime(2023, 2, 1, 0, 0, 0), #datetime(2023, 2, 1, 0, 0, 0)} , {15, #datetime(2023, 2, 1, 0, 10, 0), #datetime(2023, 1, 1, 0, 0, 0), #datetime(2023, 1, 1, 0, 0, 0), #datetime(2023, 2, 1, 0, 0, 0), #datetime(2023, 2, 1, 0, 0, 0)} , {16, #datetime(2023, 2, 1, 0, 56, 0), #datetime(2023, 1, 1, 0, 0, 0), #datetime(2023, 1, 1, 0, 0, 0), #datetime(2023, 2, 1, 0, 0, 0), #datetime(2023, 2, 1, 0, 0, 0)} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_2b.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.SelectColumns(parameter[taxi_table], {"RecordID","lpep_dropoff_datetime"}), 4 | T3 = Table.Sort(T2, {"RecordID"}), 5 | T4 = Table.AddColumn(T3, "SOW", each DateTime.ToText(Date.StartOfWeek([lpep_dropoff_datetime]))), 6 | T5 = Table.AddColumn(T4, "EOY", each DateTime.ToText(Date.EndOfYear([lpep_dropoff_datetime]))), 7 | T6 = Table.AddColumn(T5, "EOQ", each DateTime.ToText(Date.EndOfQuarter([lpep_dropoff_datetime]))), 8 | T7 = Table.AddColumn(T6, "EOM", each DateTime.ToText(Date.EndOfMonth([lpep_dropoff_datetime]))), 9 | T8 = Table.AddColumn(T7, "EOW", each DateTime.ToText(Date.EndOfWeek([lpep_dropoff_datetime]))), 10 | T9 = Table.AddColumn(T8, "EOD", each DateTime.ToText(Date.EndOfDay([lpep_dropoff_datetime]))), 11 | TA = Table.FirstN(T9, 4) 12 | in 13 | TA -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_2b.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, lpep_dropoff_datetime = datetime, SOW = any, EOY = any, EOQ = any, EOM = any, EOW = any, EOD = any] , {{4, #datetime(2023, 2, 1, 0, 26, 0), "1/29/2023 12:00:00 AM", "12/31/2023 11:59:59 PM", "3/31/2023 11:59:59 PM", "2/28/2023 11:59:59 PM", "2/4/2023 11:59:59 PM", "2/1/2023 11:59:59 PM"} , {8, #datetime(2023, 2, 1, 0, 49, 0), "1/29/2023 12:00:00 AM", "12/31/2023 11:59:59 PM", "3/31/2023 11:59:59 PM", "2/28/2023 11:59:59 PM", "2/4/2023 11:59:59 PM", "2/1/2023 11:59:59 PM"} , {15, #datetime(2023, 2, 1, 0, 10, 0), "1/29/2023 12:00:00 AM", "12/31/2023 11:59:59 PM", "3/31/2023 11:59:59 PM", "2/28/2023 11:59:59 PM", "2/4/2023 11:59:59 PM", "2/1/2023 11:59:59 PM"} , {16, #datetime(2023, 2, 1, 0, 56, 0), "1/29/2023 12:00:00 AM", "12/31/2023 11:59:59 PM", "3/31/2023 11:59:59 PM", "2/28/2023 11:59:59 PM", "2/4/2023 11:59:59 PM", "2/1/2023 11:59:59 PM"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_3.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.SelectColumns(parameter[taxi_table], {"RecordID","lpep_dropoff_datetime"}), 4 | T3 = Table.Sort(T2, {"RecordID"}), 5 | T4 = Table.AddColumn(T3, "Y+1", each DateTime.ToText(Date.AddYears([lpep_dropoff_datetime], 1))), 6 | T5 = Table.AddColumn(T4, "Q+1", each DateTime.ToText(Date.AddQuarters([lpep_dropoff_datetime], 1))), 7 | T6 = Table.AddColumn(T5, "M+1", each DateTime.ToText(Date.AddMonths([lpep_dropoff_datetime], 1))), 8 | T7 = Table.AddColumn(T6, "W+1", each DateTime.ToText(Date.AddWeeks([lpep_dropoff_datetime], 1))), 9 | T8 = Table.AddColumn(T7, "D+1", each DateTime.ToText(Date.AddDays([lpep_dropoff_datetime], 1))), 10 | T9 = Table.FirstN(T8, 4) 11 | in 12 | T9 -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_3.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, lpep_dropoff_datetime = datetime, #"Y+1" = any, #"Q+1" = any, #"M+1" = any, #"W+1" = any, #"D+1" = any] , {{4, #datetime(2023, 2, 1, 0, 26, 0), "2/1/2024 12:26:00 AM", "5/1/2023 12:26:00 AM", "3/1/2023 12:26:00 AM", "2/8/2023 12:26:00 AM", "2/2/2023 12:26:00 AM"} , {8, #datetime(2023, 2, 1, 0, 49, 0), "2/1/2024 12:49:00 AM", "5/1/2023 12:49:00 AM", "3/1/2023 12:49:00 AM", "2/8/2023 12:49:00 AM", "2/2/2023 12:49:00 AM"} , {15, #datetime(2023, 2, 1, 0, 10, 0), "2/1/2024 12:10:00 AM", "5/1/2023 12:10:00 AM", "3/1/2023 12:10:00 AM", "2/8/2023 12:10:00 AM", "2/2/2023 12:10:00 AM"} , {16, #datetime(2023, 2, 1, 0, 56, 0), "2/1/2024 12:56:00 AM", "5/1/2023 12:56:00 AM", "3/1/2023 12:56:00 AM", "2/8/2023 12:56:00 AM", "2/2/2023 12:56:00 AM"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_4.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.SelectColumns(parameter[taxi_table],{"lpep_pickup_datetime"}), 4 | T3 = Table.SelectRows(T2, each [lpep_pickup_datetime] = #datetime(2023, 02, 26, 18, 57, 00)) 5 | in 6 | T3 -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateFunctions_over_Datetime_4.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [lpep_pickup_datetime = datetime] , {{#datetime(2023, 2, 26, 18, 57, 0)} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateTimeAddDuration.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Columns = [ 4 | AddDay = each [lpep_pickup_datetime] + #duration(1,0,0,0), 5 | AddHour = each [lpep_pickup_datetime] + #duration(0,1,0,0), 6 | AddMinute = each [lpep_pickup_datetime] + #duration(0,0,1,0), 7 | AddSecond = each [lpep_pickup_datetime] + #duration(0,0,0,1), 8 | AddAll = each [lpep_pickup_datetime] + #duration(1,1,1,1.25), 9 | Subtract = each [lpep_pickup_datetime] - #duration(1,1,1,1.25) 10 | ], 11 | AddColumns = List.Accumulate(Record.FieldNames(Columns), parameter[taxi_table], 12 | (state, current) => Table.AddColumn(state, current, Record.Field(Columns, current))), 13 | Sorted = Table.Sort(AddColumns,{"total_amount", Order.Descending}), 14 | FirstN = Table.FirstN(Sorted,5) 15 | in 16 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateTimeAddDuration.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, VendorID = number, lpep_pickup_datetime = datetime, lpep_dropoff_datetime = datetime, store_and_fwd_flag = logical, RatecodeID = number, PULocationID = number, DOLocationID = number, passenger_count = number, trip_distance = number, fare_amount = number, extra = number, mta_tax = number, tip_amount = number, tolls_amount = number, improvement_surcharge = number, total_amount = number, payment_type = number, trip_type = number, congestion_surcharge = number, AddDay = any, AddHour = any, AddMinute = any, AddSecond = any, AddAll = any, Subtract = any] , {{33028, 2, #datetime(2023, 2, 16, 9, 49, 0), #datetime(2023, 2, 16, 14, 56, 0), false, 1, 223, 223, 1, 23.67, 248.70, 0.00, 0.50, 0.00, 0.00, 1.00, 250.20, 2, 1, 0.00, #datetime(2023, 2, 17, 9, 49, 0), #datetime(2023, 2, 16, 10, 49, 0), #datetime(2023, 2, 16, 9, 50, 0), #datetime(2023, 2, 16, 9, 49, 1), #datetime(2023, 2, 17, 10, 50, 1.25), #datetime(2023, 2, 15, 8, 47, 58.75)} , {13419, 2, #datetime(2023, 2, 7, 12, 14, 0), #datetime(2023, 2, 7, 15, 36, 0), false, 1, 223, 223, 1, 31.96, 197.60, 0.00, 0.50, 0.00, 0.00, 1.00, 199.10, 2, 1, 0.00, #datetime(2023, 2, 8, 12, 14, 0), #datetime(2023, 2, 7, 13, 14, 0), #datetime(2023, 2, 7, 12, 15, 0), #datetime(2023, 2, 7, 12, 14, 1), #datetime(2023, 2, 8, 13, 15, 1.25), #datetime(2023, 2, 6, 11, 12, 58.75)} , {23083, 2, #datetime(2023, 2, 11, 14, 42, 0), #datetime(2023, 2, 11, 18, 54, 0), false, 1, 119, 39, 1, 31.78, 169.00, 0.00, 0.50, 0.00, 0.00, 0.30, 169.80, 1, 1, 0.00, #datetime(2023, 2, 12, 14, 42, 0), #datetime(2023, 2, 11, 15, 42, 0), #datetime(2023, 2, 11, 14, 43, 0), #datetime(2023, 2, 11, 14, 42, 1), #datetime(2023, 2, 12, 15, 43, 1.25), #datetime(2023, 2, 10, 13, 40, 58.75)} , {54068, 2, #datetime(2023, 2, 25, 23, 10, 0), #datetime(2023, 2, 25, 23, 48, 0), false, 5, 75, 244, 1, 5.72, 160.00, 0.00, 0.00, 0.00, 0.00, 1.00, 161.00, 2, 2, 0.00, #datetime(2023, 2, 26, 23, 10, 0), #datetime(2023, 2, 26, 0, 10, 0), #datetime(2023, 2, 25, 23, 11, 0), #datetime(2023, 2, 25, 23, 10, 1), #datetime(2023, 2, 27, 0, 11, 1.25), #datetime(2023, 2, 24, 22, 8, 58.75)} , {36830, 2, #datetime(2023, 2, 17, 16, 34, 0), #datetime(2023, 2, 17, 17, 25, 0), false, 5, 244, 1, 1, 24.32, 120.00, 0.00, 0.00, 24.20, 0.00, 1.00, 145.20, 1, 2, 0.00, #datetime(2023, 2, 18, 16, 34, 0), #datetime(2023, 2, 17, 17, 34, 0), #datetime(2023, 2, 17, 16, 35, 0), #datetime(2023, 2, 17, 16, 34, 1), #datetime(2023, 2, 18, 17, 35, 1.25), #datetime(2023, 2, 16, 15, 32, 58.75)} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateTimeArithmetic.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[taxi_table], {"RecordID"}), 4 | T2 = Table.SelectColumns(Sorted, {"PULocationID","lpep_pickup_datetime"}), 5 | T3 = Table.Sort(T2, {"PULocationID"}), 6 | T4 = Table.AddColumn(T3, "Diff1", each [lpep_pickup_datetime] - #datetime(1999,1,5,0,0,0)), 7 | T5 = Table.AddColumn(T4, "Diff2", each [lpep_pickup_datetime] - #datetime(2007,2,6,0,0,0)), 8 | T6 = Table.AddColumn(T5, "Diff3", each [lpep_pickup_datetime] - #datetime(2007,9,5,0,0,0)), 9 | TA = Table.FirstN(T6, 4) 10 | in 11 | TA -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Date/DateTimeArithmetic.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [PULocationID = number, lpep_pickup_datetime = datetime, Diff1 = any, Diff2 = any, Diff3 = any] , {{3, #datetime(2023, 2, 8, 0, 36, 0), #duration(8800, 0, 36, 0), #duration(5846, 0, 36, 0), #duration(5635, 0, 36, 0)} , {7, #datetime(2023, 2, 1, 13, 21, 0), #duration(8793, 13, 21, 0), #duration(5839, 13, 21, 0), #duration(5628, 13, 21, 0)} , {7, #datetime(2023, 2, 1, 16, 8, 0), #duration(8793, 16, 8, 0), #duration(5839, 16, 8, 0), #duration(5628, 16, 8, 0)} , {7, #datetime(2023, 2, 1, 18, 33, 0), #duration(8793, 18, 33, 0), #duration(5839, 18, 33, 0), #duration(5628, 18, 33, 0)} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/FirstN/FirstNGroup.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[zone_table], {"LocationID"}), 4 | Grouped = Table.Group(Sorted, {"service_zone"}, {}), 5 | FirstN = Table.FirstN(Grouped,3), 6 | SelectColumns = Table.SelectColumns(Grouped, "service_zone") 7 | in 8 | SelectColumns -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/FirstN/FirstNGroup.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [service_zone = text] , {{"Airports"} , {"Boro Zone"} , {"EWR"} , {"N/A"} , {"Yellow Zone"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/FirstN/FirstNGroupSort.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Grouped = Table.Group(parameter[zone_table], {"service_zone"}, {}), 4 | FirstN = Table.FirstN(Grouped,5), 5 | Sorted = Table.Sort(FirstN, {{(t) => t[service_zone], Order.Ascending}}), 6 | SelectColumns = Table.SelectColumns(Sorted, "service_zone") 7 | in 8 | SelectColumns 9 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/FirstN/FirstNGroupSort.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [service_zone = text] , {{"Airports"} , {"Boro Zone"} , {"EWR"} , {"N/A"} , {"Yellow Zone"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/FirstN/FirstNSort.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[zone_table], {{(t) => t[service_zone], Order.Ascending}}), 4 | FirstN = Table.FirstN(Sorted,5), 5 | SelectColumns = Table.SelectColumns(FirstN, "service_zone") 6 | in 7 | SelectColumns 8 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/FirstN/FirstNSort.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [service_zone = text] , {{"Airports"} , {"Airports"} , {"Boro Zone"} , {"Boro Zone"} , {"Boro Zone"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/FirstN/FirstNSortGroup.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Grouped = Table.Group(Sorted, {"service_zone"}, {}), 4 | Sorted = Table.Sort(parameter[zone_table], {{(t) => t[service_zone], Order.Ascending}}), 5 | FirstN = Table.FirstN(Sorted,3), 6 | SelectColumns = Table.SelectColumns(FirstN, "service_zone") 7 | in 8 | SelectColumns 9 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/FirstN/FirstNSortGroup.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [service_zone = text] , {{"Airports"} , {"Airports"} , {"Boro Zone"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/Count.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Count = Table.Group(parameter[taxi_table], { "lpep_pickup_datetime" }, { { "Count", each List.Count([lpep_pickup_datetime]) } }), 4 | First = Count{0} 5 | in 6 | First -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/Count.query.pqout: -------------------------------------------------------------------------------- 1 | [ lpep_pickup_datetime = #datetime(2023, 1, 25, 21, 9, 0), Count = 1 ] -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListAverage.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.Group(parameter[taxi_table], {}, {{"Average", each Number.Round(List.Average([trip_distance]), 8), type number}}), 4 | FirstN = Table.FirstN(SelectColumns, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListAverage.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Average = number] , {{7.240958} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListCount.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.Group(parameter[taxi_table], {}, {{"Count", each List.Count([trip_distance]), type number}}), 4 | FirstN = Table.FirstN(SelectColumns, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListCount.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Count = number] , {{10000} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListFirst.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.Group(parameter[taxi_table], {"PULocationID"}, {{"First", each List.First([trip_distance]), type number}}), 4 | Sort = Table.Sort(SelectColumns,{"PULocationID", Order.Descending}), 5 | FirstN = Table.FirstN(Sort, 1) 6 | in 7 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListFirst.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [PULocationID = number, First = number] , {{265, 0.00} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListFirstNGroup.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[taxi_table], {"lpep_pickup_datetime", Order.Ascending}), 4 | FirstNRecords = Table.FirstN(Sorted, 10), 5 | Grouped = Table.Group(FirstNRecords, {"PULocationID"}, {"total_trip_distance", each List.Sum([trip_distance])}) 6 | in 7 | Grouped 8 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListFirstNGroup.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [PULocationID = number, total_trip_distance = any] , {{92, 15.46} , {173, 0} , {95, 0.07} , {82, 3.14} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListMax.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.Group(parameter[taxi_table], {}, {{"Maximum", each List.Max([trip_distance]), type number}}), 4 | FirstN = Table.FirstN(SelectColumns, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListMax.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Maximum = number] , {{6797.27} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListMin.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.Group(parameter[taxi_table], {}, {{"Minimum", each List.Min([trip_distance]), type number}}), 4 | FirstN = Table.FirstN(SelectColumns, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListMin.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Minimum = number] , {{0} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListNotNullCount.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.Group(parameter[taxi_table], {}, {{"Not Null Count", each List.NonNullCount([RatecodeID]), type number}}), 4 | FirstN = Table.FirstN(SelectColumns, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListNotNullCount.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [#"Not Null Count" = number] , {{9256} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListStandardDeviation.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | t = Table.Group(parameter[taxi_table], {}, {{"Standard Deviation", each List.StandardDeviation([fare_amount]), type number}}) 4 | in 5 | t -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListStandardDeviation.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [#"Standard Deviation" = number] , {{12.157206171081777} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListSum.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.Group(parameter[taxi_table], {}, {{"Sum", each Number.Round(List.Sum([trip_distance]), 8), type number}}), 4 | FirstN = Table.FirstN(SelectColumns, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldListSum.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Sum = number] , {{72409.58} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldTableRowCount.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectColumns = Table.Group(parameter[taxi_table], {}, {{"Row Count", (x) => Table.RowCount(x), type number}}), 4 | FirstN = Table.FirstN(SelectColumns, 1) 5 | in 6 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldTableRowCount.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [#"Row Count" = number] , {{10000} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldsDateTimeComparison.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[taxi_table], {"RecordID"}), 4 | SelectColumns = Table.SelectColumns(Sorted, {"lpep_pickup_datetime"}), 5 | WhereAlwaysTrue = Table.SelectRows(SelectColumns, each [lpep_pickup_datetime] <= #datetime(2023, 2, 3, 1, 0, 0.0)), 6 | FirstN = Table.FirstN(WhereAlwaysTrue, 1) 7 | in 8 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldsDateTimeComparison.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [lpep_pickup_datetime = datetime] , {{#datetime(2023, 2, 1, 0, 15, 0)} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldsTextFromDateTime.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[taxi_table], {"RecordID"}), 4 | TablePickupDateTimeCast = Table.AddColumn(Sorted, "casted_lpep_pickup_datetime", each Text.From([lpep_pickup_datetime],"en-US")), 5 | TableDropoffDateTimeCast = Table.AddColumn(TablePickupDateTimeCast, "casted_lpep_dropoff_datetime", each Text.From([lpep_dropoff_datetime],"en-US")), 6 | TableSelect = Table.SelectColumns( 7 | TableDropoffDateTimeCast, 8 | { 9 | "lpep_pickup_datetime", 10 | "lpep_dropoff_datetime", 11 | "casted_lpep_pickup_datetime", 12 | "casted_lpep_dropoff_datetime" 13 | } 14 | ), 15 | FirstN = Table.FirstN(TableSelect, 1) 16 | in 17 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Functions/FoldsTextFromDateTime.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [lpep_pickup_datetime = datetime, lpep_dropoff_datetime = datetime, casted_lpep_pickup_datetime = any, casted_lpep_dropoff_datetime = any] , {{#datetime(2023, 2, 1, 0, 15, 0), #datetime(2023, 2, 1, 0, 26, 0), "2/1/2023 12:15:00 AM", "2/1/2023 12:26:00 AM"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Join/TableJoin_1.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => let 2 | taxi_table = parameter[taxi_table], 3 | zone_table = parameter[zone_table], 4 | t1070 = Table.RenameColumns(taxi_table, {{"VendorID", "t1.VendorID"}, {"trip_distance", "t1.trip_distance"}, {"fare_amount", "t1.fare_amount"}, {"PULocationID", "t1.PULocationID"}, {"payment_type", "t1.payment_type"}}), 5 | t1071 = Table.RenameColumns(zone_table, {{"LocationID", "t0.LocationID"}, {"Borough", "t0.Borough"}, {"Zone", "t0.Zone"}}), 6 | t1072 = Table.Join(t1070, {"t1.PULocationID"}, t1071, {"t0.LocationID"}, JoinKind.LeftOuter, null), 7 | t1075 = Table.SelectRows(t1072, (t1074) => Value.Equals(t1074[t0.Borough], "Bronx") and Value.NullableEquals(Int64.From(t1074[t1.VendorID]), 1)), 8 | t1081 = Table.Group(t1075, {"t1.trip_distance", "t1.fare_amount", "t1.payment_type"}, {}), 9 | t1085 = Table.Sort(t1081, {{(t1082) => t1082[t1.trip_distance], Order.Ascending}, {(t1083) => t1083[t1.payment_type], Order.Ascending}, {(t1084) => t1084[t1.fare_amount], Order.Ascending}}), 10 | t1086 = Table.SelectColumns(t1085, {"t1.trip_distance", "t1.fare_amount", "t1.payment_type"}), 11 | FirstN = Table.FirstN(t1086, 5) 12 | in 13 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Join/TableJoin_1.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [t1.trip_distance = number, t1.fare_amount = number, t1.payment_type = number] , {{0, 15.2, 1} , {0, 16.7, 1} , {0, 18.5, 1} , {0, 19.5, 1} , {0, 19.7, 1} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Join/TableJoin_2.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => let 2 | taxi_table = parameter[taxi_table], 3 | zone_table = parameter[zone_table], 4 | t1129 = Table.RenameColumns(taxi_table, {{"VendorID", "t1.VendorID"}, {"trip_distance", "t1.trip_distance"}, {"fare_amount", "t1.fare_amount"}, {"PULocationID", "t1.PULocationID"}, {"payment_type", "t1.payment_type"}}), 5 | t1130 = Table.RenameColumns(zone_table, {{"LocationID", "t0.LocationID"}, {"Borough", "t0.Borough"}, {"Zone", "t0.Zone"}}), 6 | t1131 = Table.Join(t1129, {"t1.PULocationID"}, t1130, {"t0.LocationID"}, JoinKind.LeftOuter, null), 7 | t1134 = Table.SelectRows(t1131, (t1133) => Value.Equals(t1133[t0.Borough], "Bronx") and Value.NullableEquals(Int64.From(t1133[t1.VendorID]), 1)), 8 | t1139 = Table.Group(t1134, {"t1.payment_type"}, {{"a0", (t1135) => List.Count(List.Select(t1135[t1.VendorID], each _ <> null))}}), 9 | t1140 = Table.SelectColumns(t1139, {"t1.payment_type", "a0"}), 10 | FirstN = Table.FirstN(t1140, 5) 11 | in 12 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Join/TableJoin_2.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [t1.payment_type = number, a0 = any] , {{1, 40} , {2, 21} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Join/TableJoin_3.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => let 2 | taxi_table = parameter[taxi_table], 3 | zone_table = parameter[zone_table], 4 | t1070 = Table.RenameColumns(taxi_table, {{"VendorID", "t1.VendorID"}, {"trip_distance", "t1.trip_distance"}, {"fare_amount", "t1.fare_amount"}, {"PULocationID", "t1.PULocationID"}, {"payment_type", "t1.payment_type"}}), 5 | t1071 = Table.RenameColumns(zone_table, {{"LocationID", "t0.LocationID"}, {"Borough", "t0.Borough"}, {"Zone", "t0.Zone"}}), 6 | t1379 = Table.Join(t1070, {"t1.PULocationID"}, t1071, {"t0.LocationID"}, JoinKind.LeftOuter, null), 7 | t1136 = Table.SelectRows(t1379, (t1135) => (List.Contains({"Bronx"}, t1135[t0.Borough]) or t1135[t0.Borough] = null) and (List.Contains({1}, Int64.From(t1135[t1.VendorID])) or t1135[t1.VendorID] = null)), 8 | t1142 = Table.Group(t1136, {"t1.trip_distance", "t1.fare_amount", "t1.payment_type"}, {}), 9 | t1146 = Table.Sort(t1142, {{(t1143) => t1143[t1.trip_distance], Order.Ascending}, {(t1144) => t1144[t1.payment_type], Order.Ascending}, {(t1145) => t1145[t1.fare_amount], Order.Ascending}}), 10 | t1147 = Table.SelectColumns(t1146, {"t1.trip_distance", "t1.fare_amount", "t1.payment_type"}), 11 | FirstN = Table.FirstN(t1147, 5) 12 | in 13 | FirstN 14 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Join/TableJoin_3.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [t1.trip_distance = number, t1.fare_amount = number, t1.payment_type = number] , {{0.00, 15.20, 1} , {0.00, 16.70, 1} , {0.00, 18.50, 1} , {0.00, 19.50, 1} , {0.00, 19.70, 1} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Join/TableJoin_4.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => let 2 | taxi_table = parameter[taxi_table], 3 | zone_table = parameter[zone_table], 4 | tc = Table.PrefixColumns(taxi_table, "t0"), 5 | tp = Table.PrefixColumns(zone_table, "t1"), 6 | joined = Table.Join(tp, {"t1.LocationID"}, tc, {"t0.PULocationID"}, JoinKind.LeftOuter, null), 7 | added = Table.AddColumn(joined, "t1.LocationID_copy", (temp1) => temp1[t1.LocationID]), 8 | selected = Table.SelectColumns(added, {"t1.LocationID", "t1.LocationID_copy"}), 9 | sorted = Table.Sort(selected, {"t1.LocationID"}), 10 | FirstN = Table.FirstN(sorted, 5) 11 | in 12 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Join/TableJoin_4.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [t1.LocationID = number, t1.LocationID_copy = any] , {{1, 1} , {2, 2} , {3, 3} , {4, 4} , {5, 5} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Math/Arithmetic.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[taxi_table],{"fare_amount", Order.Descending}), 4 | Columns = [ 5 | AdditionInteger = each[PULocationID] + 90, 6 | SubtractionInteger = each [PULocationID] - 90, 7 | MultiplicationInteger = each [PULocationID] * 90, 8 | DivisionInteger = each Number.Round(([PULocationID] / 90), 8), 9 | AdditionFloat = each[fare_amount] + 90, 10 | SubtractionFloat = each [fare_amount] - 90, 11 | MultiplicationFloat = each Number.Round([fare_amount] * 90.0, 8), 12 | DivisionFloat = each Number.Round(([fare_amount] / 90.0), 8) 13 | ], 14 | AddColumns = List.Accumulate(Record.FieldNames(Columns), Sorted, 15 | (state, current) => Table.AddColumn(state, current, Record.Field(Columns, current))), 16 | SelectRows = Table.SelectRows(AddColumns, each [PULocationID] = 193), 17 | SelectColumns = Table.SelectColumns(SelectRows, Record.FieldNames(Columns)), 18 | FirstN = Table.FirstN(SelectColumns, 1) 19 | in 20 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Math/Arithmetic.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [AdditionInteger = any, SubtractionInteger = any, MultiplicationInteger = any, DivisionInteger = any, AdditionFloat = any, SubtractionFloat = any, MultiplicationFloat = any, DivisionFloat = any] , {{283, 103, 17370, 2.14444444, 125.9, -54.1, 3231, 0.39888889} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Math/NumberFunctions.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Columns = [ 4 | ABS = each Number.Abs([fare_amount]) , 5 | ACOS = each Number.Acos([fare_amount] / [fare_amount]), 6 | ASIN = each Number.Asin([fare_amount] / [fare_amount]), 7 | ATAN = each Number.Atan([fare_amount]), 8 | CEILING = each Number.RoundUp([fare_amount]), 9 | COS = each Number.Cos([fare_amount]), 10 | EXP = each Number.Exp([fare_amount]), 11 | FLOOR = each Number.RoundDown([fare_amount]), 12 | LOG = each Number.Log([PULocationID]), 13 | LOG10 = each Number.Round(Number.Log10([PULocationID]), 12), 14 | POWER = each Number.Power([fare_amount] / [fare_amount], 3), 15 | ROUND = each Number.Round([fare_amount]), 16 | ROUNDDIGITS = each Number.Round([fare_amount], 1), 17 | SIGN = each Number.Sign([fare_amount]), 18 | SQRT = each Number.Sqrt([fare_amount]), 19 | TAN = each Number.Tan([fare_amount]) 20 | ], 21 | Sorted = Table.Sort(parameter[taxi_table], {"RecordID"}), 22 | AddColumns = List.Accumulate(Record.FieldNames(Columns), Sorted, 23 | (state, current) => Table.AddColumn(state, current, Record.Field(Columns, current))), 24 | SelectRows = Table.SelectRows(AddColumns, each [PULocationID] = 170), 25 | SelectColumns = Table.SelectColumns(SelectRows, Record.FieldNames(Columns)), 26 | FirstN = Table.FirstN(SelectColumns, 1) 27 | in 28 | FirstN -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Math/NumberFunctions.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [ABS = any, ACOS = any, ASIN = any, ATAN = any, CEILING = any, COS = any, EXP = any, FLOOR = any, LOG = any, LOG10 = any, POWER = any, ROUND = any, ROUNDDIGITS = any, SIGN = any, SQRT = any, TAN = any] , {{43.20, 0, 1.5707963267948966, 1.5476523118609149, 44, 0.70929612522573282, 5774596166633850880, 43, 5.1357984370502621, 2.230448921378, 1, 43, 43.2, 1, 6.5726706900619938, -0.99381712707074343} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Math/Sum.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | AddColumn = Table.AddColumn(parameter[taxi_table], "Column", each [total_amount] + [VendorID]), 4 | SelectColumns = Table.SelectColumns(AddColumn, { "Column" }), 5 | GroupedRows = Table.Group(parameter[taxi_table], {}, {{"Column", each Number.Round(List.Sum([total_amount]), 2), type number}}) 6 | in 7 | GroupedRows -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Math/Sum.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Column = number] , {{217614.09} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Metadata/CreateNavigationPropertiesOption.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => Table.ColumnNames(Table.FirstN(parameter[taxi_table], 1)) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Metadata/CreateNavigationPropertiesOption.query.pqout: -------------------------------------------------------------------------------- 1 | {"RecordID", "VendorID", "lpep_pickup_datetime", "lpep_dropoff_datetime", "store_and_fwd_flag", "RatecodeID", "PULocationID", "DOLocationID", "passenger_count", "trip_distance", "fare_amount", "extra", "mta_tax", "tip_amount", "tolls_amount", "improvement_surcharge", "total_amount", "payment_type", "trip_type", "congestion_surcharge"} -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Metadata/NavigationMetadata.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => Value.Metadata(Value.Type(parameter[taxi_table])) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Metadata/NavigationMetadata.query.pqout: -------------------------------------------------------------------------------- 1 | [ ] -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/AddColumnWithTextStartsWith.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | AddedColumn = Table.AddColumn(parameter[zone_table], "Startswith", each Text.StartsWith([Zone], "West")), 4 | SelectRows = Table.SelectRows(AddedColumn, each [Zone] = "Westchester Village/Unionport") 5 | in 6 | SelectRows -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/AddColumnWithTextStartsWith.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [LocationID = number, Borough = text, Zone = text, service_zone = text, Startswith = any] , {{250, "Bronx", "Westchester Village/Unionport", "Boro Zone", true} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/ConcatOverflow.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sorted = Table.Sort(parameter[zone_table], {"LocationID"}), 4 | T1 = Table.AddColumn(Sorted, "CONCAT", each [Zone] & [service_zone]), 5 | T2 = Table.SelectColumns(T1, {"CONCAT"}) 6 | in 7 | T2 -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/SelectRowsStringColumn.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | SelectRows = Table.SelectRows(parameter[zone_table], each [Borough] = "Queens"), 4 | SelectColumns = Table.SelectColumns(SelectRows, { "Borough", "LocationID" }), 5 | Sort = Table.Sort(SelectColumns, {"LocationID"}), 6 | FirstN = Table.FirstN(Sort, 2) 7 | in 8 | FirstN 9 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/SelectRowsStringColumn.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Borough = text, LocationID = number] , {{"Queens", 2} , {"Queens", 7} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/StringLiteral.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sort = Table.Sort(parameter[zone_table], {"LocationID"}), 4 | SelectRows = Table.SelectRows(Sort, each [Zone] = "Westchester Village/Unionport"), 5 | SelectColumns = Table.SelectColumns(SelectRows, { "Zone" }) 6 | in 7 | SelectColumns -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/StringLiteral.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Zone = text] , {{"Westchester Village/Unionport"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/TextFromDecimal.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.Sort(parameter[taxi_table], "total_amount"), 4 | T3 = Table.FirstN(T2, 1), 5 | T4 = Table.AddColumn(T3, "textFromInt", each Text.From([VendorID])), 6 | T5 = Table.AddColumn(T4, "textFromDecimal", each Text.From([total_amount])) 7 | in 8 | T5 9 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/TextFromDecimal.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [RecordID = number, VendorID = number, lpep_pickup_datetime = datetime, lpep_dropoff_datetime = datetime, store_and_fwd_flag = logical, RatecodeID = number, PULocationID = number, DOLocationID = number, passenger_count = number, trip_distance = number, fare_amount = number, extra = number, mta_tax = number, tip_amount = number, tolls_amount = number, improvement_surcharge = number, total_amount = number, payment_type = number, trip_type = number, congestion_surcharge = number, textFromInt = any, textFromDecimal = any] , {{64670, 2, #datetime(2023, 2, 28, 8, 2, 0), #datetime(2023, 2, 28, 9, 1, 0), null, null, 235, 170, null, 21.87, -113.49, 0, 0, 1.8, 13.1, 1, -94.84, null, null, null, "2", "-94.84"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/TextFunctions.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | Sort = Table.Sort(parameter[zone_table], {"LocationID"}), 4 | Columns = [ 5 | Contains = each Text.Contains([Zone], "ton") , 6 | StartsWith = each Text.StartsWith([Zone], "Was"), 7 | EndsWith = each Text.EndsWith([Zone], "th") 8 | 9 | ], 10 | SelectRows = List.Accumulate(Record.FieldNames(Columns), Sort, 11 | (state, current) => Table.SelectRows(state, Record.Field(Columns, current))), 12 | SelectColumns = Table.SelectColumns(SelectRows, { "Zone" }), 13 | Buffer = Table.Buffer(SelectColumns) 14 | in 15 | Buffer -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Text/TextFunctions.query.pqout: -------------------------------------------------------------------------------- 1 | #table( type table [Zone = text] , {{"Washington Heights North"} , {"Washington Heights South"} } ) -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Time/TimeFunctions_EndOfHour.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.AddColumn(parameter[taxi_table], "eoh", each DateTime.ToText(Time.EndOfHour([lpep_pickup_datetime]))), 4 | T_Sorted = Table.Sort(T2, "RecordID") 5 | in 6 | T_Sorted -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Time/TimeFunctions_Hour.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.AddColumn(parameter[taxi_table], "hour", each Time.Hour([lpep_pickup_datetime])), 4 | T_Sorted = Table.Sort(T2, "RecordID") 5 | in 6 | T_Sorted 7 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Time/TimeFunctions_Minute.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.AddColumn(parameter[taxi_table], "minute", each Time.Minute([lpep_pickup_datetime])), 4 | T_Sorted = Table.Sort(T2, "RecordID") 5 | in 6 | T_Sorted -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Time/TimeFunctions_Second.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.AddColumn(parameter[taxi_table], "second", each Time.Second([lpep_pickup_datetime])), 4 | T_Sorted = Table.Sort(T2, "RecordID") 5 | in 6 | T_Sorted 7 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Time/TimeFunctions_StartOfHour.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T2 = Table.AddColumn(parameter[taxi_table], "soh", each Time.StartOfHour([lpep_pickup_datetime])), 4 | T_Sorted = Table.Sort(T2, "RecordID") 5 | in 6 | T_Sorted 7 | -------------------------------------------------------------------------------- /testframework/tests/TestSuites/Standard/Time/TimeFunctions_TimeSecond.query.pq: -------------------------------------------------------------------------------- 1 | (parameter) => 2 | let 3 | T_Sorted = Table.Sort(parameter[taxi_table], "RecordID") , 4 | T2 = Table.AddColumn(T_Sorted, "second", each Time.Second([lpep_pickup_datetime])), 5 | T3 = Table.SelectColumns(T2, {"lpep_pickup_datetime", "second"}) 6 | in 7 | T3 8 | --------------------------------------------------------------------------------