Skip to content

Instantly share code, notes, and snippets.

View DaveRuijter's full-sized avatar

Dave Ruijter DaveRuijter

View GitHub Profile
@PaoloLeonard
PaoloLeonard / expect_table_row_count_to_be_more_than_others.py
Last active October 28, 2022 11:06
Full implementation of a custom table expectation that compares the considered dataset row count to other datasets row count with the possibility of using different comparison keys.
"""
Custom table expectation which checks whether the row count is greater than the row count of other tables.
There are different ways to compare the row counts:
* With absolute values, if one row count value of the other tables is greater than the current then the validation
fails,
* With mean values, if the mean of value of the other tables row count is greater than the current row count then
the validation fails.
"""
from copy import deepcopy
@DaveRuijter
DaveRuijter / RemoveServicePrincipalFromPowerBIWorkspaces.ps1
Created September 21, 2020 11:23
Script to remove Service Principal from Power BI workspaces
# =================================================================================================================================================
## This script will remove the given Service Principal from Power BI workspaces
## It will first ask for the (correct) ObjectId of the Service Principal
## Then it will ask for the credentials of a Power BI Service Administrator
# =================================================================================================================================================
## Parameters
# Remove the Service Principal from workspaces that are in Premium capacity?
$RemoveFromPremiumCapacityWorkspaces = $true
@DaveRuijter
DaveRuijter / AddServicePrincipalToPowerBIWorkspaces.ps1
Last active July 22, 2022 09:11
Script to add Service Principal to Power BI workspaces
# =================================================================================================================================================
## This script will add the given Service Principal to Power BI workspaces
## It will first ask for the (correct) ObjectId of the Service Principal
## Then it will ask for the credentials of a Power BI Service Administrator
## Note: this script only works with v2 workspaces (you can't add a Service Principal to a v1 workspace)
# =================================================================================================================================================
## Parameters