Query: contains doesn't work with long prefix that end with 1
@vinay-google já está trabalhando nisso.
Desde 2/2/2023.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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)
- Linguagem predominante
- Python
- Estrelas
- 1.4k
- Forks
- 917
- Merge médio
- 3min
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de googleworkspace/python-samples
-
ايقاف البحث الأمنTalvez livre de novo @sqrrrl assumiu há 400 dias e não há nenhum pull request aberto. Aberta
googleworkspace/python-samples#2434 · 1 responsável ·
-
Slow Uploads using Google Drive API with PythonTalvez livre de novo @sqrrrl assumiu há 740 dias e não há nenhum pull request aberto. Aberta
googleworkspace/python-samples#1852 · 1 comentário · 1 responsável ·
-
403 error from google after a few successful runs of my codeTalvez livre de novo @vinay-google assumiu há 912 dias e não há nenhum pull request aberto. Aberta
googleworkspace/python-samples#1424 · 1 responsável ·
-
How to see the progress of files which is getting uploadedTalvez livre de novo @vinay-google assumiu há 928 dias e não há nenhum pull request aberto. Aberta
googleworkspace/python-samples#1404 · 1 responsável ·
-
Phyton SamplesTalvez livre de novo @PierrickVoulet assumiu há 975 dias e não há nenhum pull request aberto. Aberta
googleworkspace/python-samples#1279 · 1 responsável ·
Todas as issues de googleworkspace/python-samples
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
canonical/paas-charm#407 · 1 comentário ·
Mantenedores costumam responder em até 5 dias
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
FAIRmat-NFDI/pynxtools-spm#136 ·
Mantenedores costumam responder em até 1 dia
-
enhancement tooling
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
`read_nexus` entry point points to a function that no longer existsTalvez já em andamento @RubelMozumder assumiu hoje. Abertaannotator bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
FAIRmat-NFDI/pynxtools#876 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[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 retryingTalvez já em andamento @yipinghuang1991 assumiu hoje. Abertacomp/agent P2 type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NousResearch/hermes-agent#156837 ·
Mantenedores costumam responder em até 1 dia