Skip to content

Commit

Permalink
Remove trailing spaces (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
flanakin authored Dec 16, 2023
1 parent febd94c commit 8dc9b91
Show file tree
Hide file tree
Showing 46 changed files with 498 additions and 467 deletions.
12 changes: 6 additions & 6 deletions .build/BuildHelper/Add-CopyrightHeader.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<#
.SYNOPSIS
Adds a standard copyright header to all files in the repository that don't already have it.
.DESCRIPTION
Run this from the /src/scripts folder.
.EXAMPLE
./Add-CopyrightHeader
Expand All @@ -19,12 +19,12 @@ function Add-CopyrightHeader
param
(
[Parameter()]
[ValidateScript({Test-Path -Path $_})]
[ValidateScript({ Test-Path -Path $_ })]
[string]
$Path = "$PSScriptRoot/../.."
)

$Path = (Resolve-Path -Path $Path).Path
$Path = (Resolve-Path -Path $Path).Path

# Header lines to add to the top of each file
$headerLines = @( "Copyright (c) Microsoft Corporation.", "Licensed under the MIT License." )
Expand All @@ -37,7 +37,7 @@ function Add-CopyrightHeader
psm1 = "#"
}

$exclude = '*.abf', '*.xml', '*.yml', '*.bim', '.buildignore', '.editorconfig', '.prettierrc', '.gitignore', '*.json', '*.md', '*.pbidataset', '*.pbip', '*.pbir', '*.pbix', '*.png', '*.svg'
$exclude = '*.abf', '*.xml', '*.yml', '*.bim', '.buildignore', '.editorconfig', '.prettierrc', '.gitignore', '*.json', '*.md', '*.pbidataset', '*.pbip', '*.pbir', '*.pbix', '*.png', '*.svg'
$newLine = [Environment]::NewLine

$valid = 0
Expand All @@ -59,7 +59,7 @@ function Add-CopyrightHeader
$notSupported++
continue
}

# Build the header
$header = "$commentChar " + ($headerLines -join "$newLine$commentChar ") + $newLine + $newLine

Expand Down
2 changes: 1 addition & 1 deletion .build/build.depends.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Force = $true
AllowClobber = $true
}

InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
Pester = 'latest'
Expand Down
4 changes: 2 additions & 2 deletions .build/start.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ param
[Parameter()]
[string]
$ApiKey,

[Parameter()]
[switch]
$Major,
Expand Down Expand Up @@ -48,7 +48,7 @@ if (-not $env:CI)
if ($repository.InstallationPolicy -ne 'Trusted') {
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
}

try {
Install-Module -Name 'PsDepend' -Force -AllowClobber -Scope CurrentUser -ErrorAction 'Stop'
} catch {
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ assignees: ''
As a **<TODO: What persona is this for?>**, I need to **<TODO: What action does the user need to perform?>** in order to **<TODO: What is the goal? Why is this needed?>**

## 💎 Solution
TODO: Add a clear and concise description of what you want to happen. Focus on the outcome, not the implementation details.
TODO: Add a clear and concise description of what you want to happen. Focus on the outcome, not the implementation details.

## ℹ️ Additional context
TODO: Add any other context or screenshots about the change request, including alternative solutions you considered and why you ruled them out.
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/🚀-release--internal-only-.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ assignees: flanakin
As a **<TODO: What persona is this for?>**, I need to **<TODO: What action does the user need to perform?>** in order to **<TODO: What is the goal? Why is this needed?>**

## 🚀 Goal
TODO: Add a clear and concise description of what people will be able to do when this release is available. Focus on the outcome, not the implementation details.
TODO: Add a clear and concise description of what people will be able to do when this release is available. Focus on the outcome, not the implementation details.

## 📋 Tasks
<!-- TODO: Create separate task lists for each sub-release. It's okay to only have 1. -->
Expand All @@ -32,7 +32,7 @@ TODO: Add a clear and concise description of what people will be able to do when
<!-- TODO: Add stretch items to a separate task list. -->
```[tasklist]
### Stretch
- [ ] TODO: Add tasks
- [ ] TODO: Add tasks
```

## 🙋‍♀️ Ask for the community
Expand Down
4 changes: 2 additions & 2 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Support

## How to file issues and get help
## How to file issues and get help

This project uses GitHub issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.

<!--
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
-->

## Microsoft Support Policy
## Microsoft Support Policy

Support for this project is limited to the resources listed above.
8 changes: 4 additions & 4 deletions docs/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Results in: HTML for the head element.
Includes:
css/activation.scss.liquid, head_custom.html.
Overwrites:
Overwrites:
ga_tracking_ids, ga_property, file, favicon.
Should not be cached, because included files depend on page.
{%- endcomment -%}
Expand All @@ -21,11 +21,11 @@
<script type="text/javascript" src="{{ '/assets/js/theme-switch.js' | relative_url }}" defer></script>
<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-switchable.css' | relative_url }}">
{%- comment -%} =========================================================================== {%- endcomment -%}

<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-default.css' | relative_url }}">

<link rel="stylesheet" href="{{ '/assets/css/just-the-docs-head-nav.css' | relative_url }}">

<style id="jtd-nav-activation">
{% include css/activation.scss.liquid %}
</style>
Expand Down
2 changes: 1 addition & 1 deletion docs/finops-hub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ We are very early in our journey. Today, FinOps hubs extend Cost Management by e

<blockquote class="highlight-green-title" markdown="1">
💵 Estimated cost: $25 per $1M in cost

Exact cost of the solution may vary. Cost is primarily for data storage and number of times data is ingested. Pipelines will run once a day per export.
</blockquote>

Expand Down
46 changes: 23 additions & 23 deletions src/power-bi/queries/ftk_LoadData.pq
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ let
// datasets -- Allowed values: 0 = actual, 1 = amortized, 2 = both
// DoNotNormalize -- For testing only; true/false

// VS Code: Uncomment for intellisense in VS Code, but do not include in Power BI reports --
// VS Code: Uncomment for intellisense in VS Code, but do not include in Power BI reports --
AzureCostManagement.Tables = () => "", ftk_NormalizeSchema = () => "", #"Data Source" = "FinOps hubs", #"Storage URL" = "", #"File Type" = "", #"RangeStart" = null, #"RangeEnd" = null, #"Billing Account ID" = "123", #"Billing Profile ID" = "", #"Number of Months" = 3,

// TODO: Remove SourceType
SourceType = #"Data Source",
Connector =
Connector =
let
// Default values
ba = #"Billing Account ID",
bp = #"Billing Profile ID",
mo = #"Number of Months",

IsMCA = ba <> null and Text.Contains(ba, "-"),
Scope =
Scope =
if ba = null then null
else if IsMCA then "/providers/Microsoft.Billing/billingAccounts/" & ba & (if Text.Length(bp) = 0 then "" else ("/billingProfiles/" & bp))
else if Text.Length(ba) > 0 then ba
Expand Down Expand Up @@ -51,8 +51,8 @@ let
_usdCol2 = _colName(secondaryCol, "CostInUsd"),

RenamePrimary = Table.RenameColumns(tbl, {
{ (if Table.HasColumns(tbl, "CostInBillingCurrency") then "CostInBillingCurrency" else if Table.HasColumns(tbl, "Cost") then "Cost" else "PreTaxCost"), primaryCol },
{ "CostInPricingCurrency", _pricingCol1 },
{ (if Table.HasColumns(tbl, "CostInBillingCurrency") then "CostInBillingCurrency" else if Table.HasColumns(tbl, "Cost") then "Cost" else "PreTaxCost"), primaryCol },
{ "CostInPricingCurrency", _pricingCol1 },
{ "CostInUsd", _usdCol1 }
}, MissingField.UseNull),
PrimaryTypes = Table.TransformColumnTypes(RenamePrimary, {{ primaryCol, type number }, { _pricingCol1, type number }, { _usdCol1, type number }}),
Expand All @@ -65,9 +65,9 @@ let
SecondaryUsdCurrency
,

AmortizedData = if datasets = 0 then null else
AmortizedData = if datasets = 0 then null else
let
Data = if SourceType <> "FinOps hubs" then Connector{[Key="usagedetailsamortized"]}[Data] else
Data = if SourceType <> "FinOps hubs" then Connector{[Key="usagedetailsamortized"]}[Data] else
// Load from hub
let
// Default values
Expand All @@ -90,34 +90,34 @@ let
FilterFilesByMetricAndFileType = Table.SelectRows(SplitDates_type, each [Metric] = "amortizedcost" and [Extension] = ext),

// Only process files for months within the date range
FilterFilesByDate =
FilterFilesByDate =
if start = null and end = null then FilterFilesByMetricAndFileType
else Table.SelectRows(FilterFilesByMetricAndFileType, each (start = null or [StartDate] >= Date.StartOfMonth(Date.From(start))) and (end = null or [EndDate] <= Date.EndOfMonth(Date.From(end)))),

// Extract
unpack = (zipData) => Table.PromoteHeaders(Csv.Document(Binary.Decompress(zipData, Compression.GZip), [Delimiter=",", Columns=60, Encoding=1252, QuoteStyle=QuoteStyle.Csv, CsvStyle=CsvStyle.QuoteAlways]), [PromoteAllScalars=true]),
SelectContent = Table.SelectColumns(FilterFilesByDate, {"Content"}),
UnpackContent = Table.AddColumn(SelectContent, "Custom", each if ext = ".gz" then unpack([Content]) else Parquet.Document([Content])),
ExpandedColumns = Table.ExpandTableColumn(UnpackContent, "Custom", List.Sort(Table.ColumnNames(List.First(UnpackContent[Custom], null)))),
RemovedContent = Table.RemoveColumns(ExpandedColumns, {"Content"}),

// Only pull from the predefined date range (if specified)
tbl = RemovedContent,
FilterRowsByDate =
FilterRowsByDate =
if start = null and end = null then tbl
else Table.SelectRows(tbl, each
(start = null or (if Table.HasColumns(tbl, "Date") then Date.From([Date]) else Date.From([date])) >= Date.From(start))
else Table.SelectRows(tbl, each
(start = null or (if Table.HasColumns(tbl, "Date") then Date.From([Date]) else Date.From([date])) >= Date.From(start))
and (end = null or (if Table.HasColumns(tbl, "Date") then Date.From([Date]) else Date.From([date])) < Date.From(end))
)
in
FilterRowsByDate
,
DataSet = if Data = null then null else Table.AddColumn(_capitalizeAndSortColumns(Data), "DataSet", each "AmortizedCost"),
AmortizedCost = _renameCost(DataSet, "AmortizedCost", "BilledCost", (col) => each
if (_isBlank([ReservationId])
and [PricingModel] <> "Reservation"
and [PricingModel] <> "SavingsPlan"
and Text.Lower([ConsumedService]) <> "microsoft.capacity"
AmortizedCost = _renameCost(DataSet, "AmortizedCost", "BilledCost", (col) => each
if (_isBlank([ReservationId])
and [PricingModel] <> "Reservation"
and [PricingModel] <> "SavingsPlan"
and Text.Lower([ConsumedService]) <> "microsoft.capacity"
and (Table.HasColumns(DataSet, "BenefitId") = false or _isBlank([BenefitId]))
) then Record.Field(_, col) else 0.0)
in
Expand All @@ -129,13 +129,13 @@ let
// Pull actual cost from connector, filter down to commitment purcahses
Data = Connector{[Key="usagedetails"]}[Data],
DataSet = Table.AddColumn(Data, "DataSet", each "ActualCost"),
CommitmentPurchasesOnly =
CommitmentPurchasesOnly =
if datasets = 0 then
// Don't filter if only using the actual dataset
DataSet
else if Table.HasColumns(DataSet, "ChargeType") then
Table.SelectRows(DataSet, each [ChargeType] = "Purchase" and ([PricingModel] <> "Reservation" or [PricingModel] <> "SavingsPlan" or Text.Lower([ConsumedService]) = "microsoft.capacity"))
else
else if Table.HasColumns(DataSet, "ChargeType") then
Table.SelectRows(DataSet, each [ChargeType] = "Purchase" and ([PricingModel] <> "Reservation" or [PricingModel] <> "SavingsPlan" or Text.Lower([ConsumedService]) = "microsoft.capacity"))
else
// If no ChargeType, then there aren't any commitment purchases
null
,
Expand Down
Loading

0 comments on commit 8dc9b91

Please sign in to comment.