老布這麼說
Yet another bootstrap theme.
2021-12-09
Read More
2021-12-09
在針對不同的 telemetry-type 實作不同的 de-normalize & to_parquet 時,覺得這滿適合用 Factory Pattern 的,就花些時間來試試看囉
這樣做,覺得滿好的
Reference
- The Factory Method Pattern and Its Implementation in Python – Real Python 這篇很有用,我就是看這篇邊改邊實作的
- [Design Pattern] Factory Method 工廠方法 - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天 這篇較簡略,我反而不容易懂。不過,倒是看了這篇後,才覺得我也是可以用 Factory Pattern 的
- 什麼?又是/不只是 Design Patterns!? :: 第 11 屆 iThome 鐵人賽 找時間將這部分看一下,有個印象,才好深入
同場加映
- Python Tutorials – Real Python 有找到啥 keyword or 方式,想看看如何運用、實作可。嘗試,在這網站找找看
2021-12-09
在找看看如何將 parquet file 寫到 S3 時,意外找到 aws-data-wrangler package,覺得還滿好用的
Reference
- awslabs/aws-data-wrangler: Pandas on AWS - Easy integration with Athena, Glue, Redshift, Timestream, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretManager, PostgreSQL, MySQL, SQLServer and S3 (Parquet, CSV, JSON and EXCEL).
- aws-data-wrangler/tutorials at main · awslabs/aws-data-wrangler 建議這份 tutorial 要整份看過一次
- amazon s3 - How to write parquet file from pandas dataframe in S3 in python - Stack Overflow
2021-12-08
在 debug python 的時候,總想知道有沒有 call 到某個 function,目前是有用 decorator 來用
進階的方式為使用 dataclass,這還要找時間來試試囉
Reference
2021-12-08
Read More
2021-12-07
Read More
2021-12-06
Read More
2021-12-05
一開始是用 Docs overview | hashicorp/aws | Terraform Registry & aws-samples/aws-stepfunctions-ecs-fargate-process 範例來進行整合 step-function & ecs fargate 的流程
範例中,是直接用 aws resource & 自行定義 iam_role & policy 的方式,這方式可以清楚的了解 iam_role, policy 的運作,不過有點太苦囉
接著在 google 的過程中,有看到 Terraform AWS modules 的方式,在原來的基本上往上包了一層,提供更加方式使用 aws module 的方式
覺得滿好用的,接下來新增的部分,會先從 AWS module 來找找看,如何使用
Reference
- Terraform AWS modules | Terraform Registry 官方 aws module page
- Terraform AWS modules 官方的 gitHub page
2021-12-04
Read More
2021-12-02
用 curl 送檔案到 api 的方式
方式
- 用 post request 的方式
curl -X PUT -d '{"id": 1}' https://reqbin.com/echo/post/json
- 用 post file 的方式
curl -d @path/to/data.json https://reqbin.com/echo/post/json