Skip to content

Instantly share code, notes, and snippets.

View Shinichi-Nakagawa's full-sized avatar

Shinichi Nakagawa Shinichi-Nakagawa

View GitHub Profile
# リソースグループ
resource "azurerm_resource_group" "example" {
name = "example-rg"
location = "East US"
}
# Container App の作成(システム割り当てマネージド ID を有効化)
resource "azurerm_container_app" "example" {
name = "example-container-app"
resource_group_name = azurerm_resource_group.example.name
resource "azurerm_container_app_environment" "uwa_container_app_environment" {
name = "uwa-container-app-env"
resource_group_name = azurerm_resource_group.uwa_resource_group.name
location = azurerm_resource_group.uwa_resource_group.location
internal_load_balancer_enabled = false
infrastructure_subnet_id = azurerm_subnet.container_app_subnet.id
}
resource "azurerm_container_app" "uwa_container_app" {
name = "uwa-container-app"
resource "azurerm_storage_account" "uwa_uwa_storage" {
name = "uwa-uwastorageaccount"
resource_group_name = azurerm_resource_group.uwa_uwa_rg.name
location = azurerm_resource_group.uwa_uwa_rg.location
account_tier = "Standard"
account_replication_type = "LRS"
}
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
}
required_version = ">= 0.14.9"
}
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0"
}
}
required_version = ">= 0.14.9"
}
@Shinichi-Nakagawa
Shinichi-Nakagawa / npb2023_teamstats.ipynb
Last active September 30, 2023 08:20
npb2023_teamstats.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Shinichi-Nakagawa
Shinichi-Nakagawa / npb2023_teamstats.ipynb
Created September 24, 2023 09:13
npb2023_teamstats.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Shinichi-Nakagawa
Shinichi-Nakagawa / snipet_pyspark_02.py
Last active November 8, 2022 08:11
PyCon JP 2022資料用スニペット
"""
5. BigQuery読込
"""
from pyspark.sql import SparkSession
from pyspark.sql import DataFrame as SparkDataFrame
from pyspark.sql.utils import AnalysisException
# ここは同じ
spark: SparkSession = SparkSession \
@Shinichi-Nakagawa
Shinichi-Nakagawa / snipet_pyspark_01.py
Last active October 14, 2022 15:31
PyCon JP 2022資料用のスニペット
"""
1. Sessionを作る
"""
from pyspark.sql import SparkSession
# BigQueryを使う&Stringの範囲を広げる
spark: SparkSession = SparkSession \
.builder \
.appName(‘app_yakiu')\
@Shinichi-Nakagawa
Shinichi-Nakagawa / csv2bq.py
Last active July 10, 2022 07:34
DataprocでBaseball savantデータを集計する(保存済みのCSVがGCSにあったとして)
from datetime import datetime
import os
from pyspark.sql import SparkSession
from pyspark.sql import DataFrame as SparkDataFrame
from pyspark.sql.utils import AnalysisException
from pyspark.sql.types import StructType, StructField, DoubleType, DateType, StringType, LongType
spark = SparkSession \
.builder \
.appName('app_334')\