Query: contains doesn't work with long prefix that end with 1
@vinay-google がすでに取り組んでいます。
2023年2月2日 から。
評価
この issue はまだ評価されていません。
説明
Summary
When querying using name contains option, if the prefix ends with '1' it fails for all words above 19 characters.
Escaping the "\1" somehow fixes it (why though)
Excluding it by cutting the prefix short: works.
Using the full file name: works
Expected Behavior
- Get a list of files that have the prefix
Actual Behavior
- Returns empty list
Steps to Reproduce the Problem
from google.oauth2.service_account import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseDownload
import io
scoped_creds = Credentials.from_service_account_info(creds, scopes=SCOPES)
gdrive = build("drive", "v3", credentials=scoped_creds)
parent_id = ""
data = io.BytesIO()
file_metadata = {
"name": "thistwentyletterword_20230122",
# "mimeType": "application/vnd.google-apps.spreadsheet",
"parents": ["parent_id"]
}
media = MediaIoBaseUpload(data, mimetype="text/csv", resumable=True)
# pylint: disable=maybe-no-member
print(
gdrive.files()
.create(
supportsAllDrives=True, body=file_metadata, media_body=media, fields="id"
)
.execute()
)
# -> {'id': 'long_generated_file_id'}
# search for file with 'thistwentyletterword_202301'
# adding more characters after the '1' fails as well as long as it's not the full file name.
print(
gdrive.files()
.list(
spaces="drive",
q=f"""\
mimeType != 'application/vnd.google-apps.folder'\
and name contains 'thistwentyletterword_202301'\
and trashed=false
""",
fields="files(id, name, mimeType)",
)
.execute()
.get("files")
)
# out-> []
# Escape the "\1"
print(
gdrive.files()
.list(
spaces="drive",
q=f"""\
mimeType != 'application/vnd.google-apps.folder'\
and name contains 'thistwentyletterword_20230\1'\
and trashed=false
""",
fields="files(id, name, mimeType)",
)
.execute()
.get("files")
)
# out-> [{'mimeType': 'text/csv', 'id': 'long_generated_file_id', 'name': 'thistwentyletterword_20230122'}]
Specifications
- Python version (
python --3.10.7) - OS (Mac/Linux/Windows)
- 主要言語
- Python
- スター
- 1.4k
- フォーク
- 917
- 平均マージ
- 3分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleworkspace/python-samples のほかの issue
-
ايقاف البحث الأمن再び着手できるかも @sqrrrl が 400 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
googleworkspace/python-samples#2434 · 担当者 1 名 ·
-
Slow Uploads using Google Drive API with Python再び着手できるかも @sqrrrl が 740 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
googleworkspace/python-samples#1852 · コメント 1 件 · 担当者 1 名 ·
-
403 error from google after a few successful runs of my code再び着手できるかも @vinay-google が 912 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
googleworkspace/python-samples#1424 · 担当者 1 名 ·
-
How to see the progress of files which is getting uploaded再び着手できるかも @vinay-google が 928 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
googleworkspace/python-samples#1404 · 担当者 1 名 ·
-
Phyton Samples再び着手できるかも @PierrickVoulet が 975 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
googleworkspace/python-samples#1279 · 担当者 1 名 ·
googleworkspace/python-samples の issue をすべて見る
似ている issue
-
[Bug]: HTTP 499 (Client Closed Request) is classified as a non-retryable format_error, so a mid-flight abort fails the turn over instead of retrying対応中かも @yipinghuang1991 が今日担当しました。 オープンcomp/agent P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NousResearch/hermes-agent#156837 ·
メンテナーはふだん 1 日以内に返信
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yields対応中かも @muskan-creates352 が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
fedora-infra/anitya#2188 ·
メンテナーはふだん 1 日以内に返信
-
docs documentation need-triage SaaS
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
integration:hermes
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
vectorize-io/hindsight#6601 ·
メンテナーはふだん 1 日以内に返信
-
triage:product type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
dbt-labs/dbt-adapters#2333 ·
メンテナーはふだん 1 日以内に返信