by shigemk2

当面は技術的なことしか書かない

hub v2.12.1

  • プルリクでクラッシュするのを回避
  • BROWSER変数で開くブラウザを指定
  • hub helpmanをサポート
  • -aとか-lとかで複数指定するときにスペースをあけない

  • hub pull-request: Avoid crash when the current branch is pushed to a non-GitHub remote

  • BROWSER environment variable now supports values with spaces in them (must be shell-quoted)
  • hub help: support man appearing in a path that has spaces
  • Docs: mention that comma-separated lists must not have spaces

Release v2.12.1 · github/hub · GitHub

Presto date_formatでGENERIC_INTERNAL_ERROR: String index out of range 続き

Presto date_formatでGENERIC_INTERNAL_ERROR: String index out of range

この話の続き。jodaは使われているには使われているけどフォーマットを生成するのにループで取り回してる。でもバイト数でループするもんだから、'%Y年%m月%d日' みたいな書き方をするとバイト数と文字数が一致しなくなるのでループのところで死ぬ。presto-cliなどではdebugオプションで分かるけどAthenaじゃそんなオプションはない。

GENERIC_INTERNAL_ERROR: String index out of range when using multibyte string in date_format's format · Issue #13022 · prestodb/presto · GitHub

バグです。ありがとうございました。たぶん週末までには取り込まれることでしょう。それでもこれが直っているのをAthenaで拝められるのはどのくらい先だろうな……

Presto date_formatでGENERIC_INTERNAL_ERROR: String index out of range

SELECT DATE_FORMAT(now() AT TIME ZONE 'Asia/Tokyo', '%Y年%m月%d日')

こんなクエリを投げると、GENERIC_INTERNAL_ERROR: String index out of range: 9 って返ってくる。詳細なエラーはない。本当にこれだけ。まあdate_format関数のフォーマット書式に日本語が入っているのが駄目なんだろうけど。

期待薄だけどissueは投げた

Prestoのフォーマットのパースにはjodaを使っているようだから2.10.2と2.4で試したけど、jodaのforPatternは日本語には対応しているから、jodaが原因ではないようなんだよな、わからないけど。

scala> import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormat

scala> DateTimeFormat.forPattern("yyyy年MM月dd日")
res0: org.joda.time.format.DateTimeFormatter = org.joda.time.format.DateTimeFormatter@65f6c623

scala> DateTimeFormat.forPattern("yyyy年MM月dd日").parseDateTime("2011年10月31日")
res1: org.joda.time.DateTime = 2011-10-31T00:00:00.000+09:00

awscli 1.16.185

APIのアップデート

  • api-change:apigateway: Update apigateway command to latest version
  • api-change:ssm: Update ssm command to latest version
  • api-change:apigatewayv2: Update apigatewayv2 command to latest version
  • api-change:elbv2: Update elbv2 command to latest version
  • api-change:application-insights: Update application-insights command to latest version
  • api-change:fsx: Update fsx command to latest version
  • api-change:service-quotas: Update service-quotas command to latest version
  • api-change:resourcegroupstaggingapi: Update resourcegroupstaggingapi command to latest version
  • api-change:securityhub: Update securityhub command to latest version

Release 1.16.185 · aws/aws-cli · GitHub

PyGitHub get_issues

Issueの情報を取得する。sinceがあってuntilがないのは、公式のAPIにuntilがないから。あとsinceは更新日時基準。

Repository — PyGithub 1.43.7 documentation

Issues | GitHub Developer Guide

GITHUB_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
g = Github(GITHUB_TOKEN)
repo = g.get_organization("user_org").get_repo("user_repo")
issues = repo.get_issues(assignee="user_name", state="closed", labels=[repo.get_label(name="ラベル")])