Skip to content

Commit

Permalink
Rename files and chnage M for showing fx text instead of error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar committed Apr 19, 2024
1 parent c27888d commit 2ac0083
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 17 additions & 3 deletions M.pq
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ let
Headers = QueryHeaders
]
))[content],
#"To text" =
#"To function" =
Expression.Evaluate(
Text.FromBinary(
Binary.FromText(#"Get functions fx")
Expand All @@ -74,6 +74,7 @@ let
Any.Type = Any.Type,
Binary.ToText = Binary.ToText,
BinaryEncoding.Base64 = BinaryEncoding.Base64,
Comparer.OrdinalIgnoreCase = Comparer.OrdinalIgnoreCase,
Date.AddDays = Date.AddDays,
Date.Day = Date.Day,
Date.DayOfWeek = Date.DayOfWeek,
Expand Down Expand Up @@ -184,12 +185,25 @@ let
]
)
in
#"To text",
#"To function",
#"Get PQ text fx" = (relativePath as text) =>
let
#"Get functions fx" = Json.Document(Web.Contents(
BaseURL,[
RelativePath = GitHubUser&"/"&GitHubRepo&"/git/blobs/"&relativePath,
Query = [],
Headers = QueryHeaders
]
))[content],
#"To function" =
Text.FromBinary(Binary.FromText(#"Get functions fx"))

in
#"To function",
#"Get PQ functions" = Table.TransformColumns(
#"Extracted Text After Delimiter",
{
"url", each #"Get PQ functions fx"(_)
"url", each try #"Get PQ functions fx"(_) otherwise #"Get PQ text fx"(_)
}
),
#"Merged Columns" = Table.CombineColumns(#"Get PQ functions",{"Type","Path"},Combiner.CombineTextByDelimiter(".", QuoteStyle.None),"Name"),
Expand Down
28 changes: 25 additions & 3 deletions M_Creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'bibb.pro',
'community.powerbi',
'community.fabric',
'Date.Today',
'Documentation.Author',
'Documentation.Examples',
'Documentation.FieldCaption',
Expand All @@ -19,8 +20,16 @@
'Formatting.IsCode',
'Formatting.IsMultiLine',
'gorilla.bi',
'List.DotProduct',
'List.Flatten',
'List.Norm',
'microsoft.com',
'odata.nextLink',
'Table.ToM',
'Text.Collapse',
'Text.ContainsAll',
'Text.ContainsAny',
'Text.ReplaceMany',
'Web.Contents', #Unfortunately adding this function to the M code will create a dynamic error :(
'www.linkedin',
'youtu.be',
Expand Down Expand Up @@ -96,7 +105,7 @@
Headers = QueryHeaders
]
))[content],
#"To text" =
#"To function" =
Expression.Evaluate(
Text.FromBinary(
Binary.FromText(#"Get functions fx")
Expand All @@ -107,12 +116,25 @@
]
)
in
#"To text",
#"To function",
#"Get PQ text fx" = (relativePath as text) =>
let
#"Get functions fx" = Json.Document(Web.Contents(
BaseURL,[
RelativePath = GitHubUser&"/"&GitHubRepo&"/git/blobs/"&relativePath,
Query = [],
Headers = QueryHeaders
]
))[content],
#"To function" =
Text.FromBinary(Binary.FromText(#"Get functions fx"))
in
#"To function",
#"Get PQ functions" = Table.TransformColumns(
#"Extracted Text After Delimiter",
{
"url", each #"Get PQ functions fx"(_)
"url", each try #"Get PQ functions fx"(_) otherwise #"Get PQ text fx"(_)
}
),
#"Merged Columns" = Table.CombineColumns(#"Get PQ functions",{"Type","Path"},Combiner.CombineTextByDelimiter(".", QuoteStyle.None),"Name"),
Expand Down

0 comments on commit 2ac0083

Please sign in to comment.