Query: contains doesn't work with long prefix that end with 1
@vinay-google ya está trabajando en esto.
Desde el 2/2/2023.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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)
- Lenguaje dominante
- Python
- Estrellas
- 1.4k
- Forks
- 917
- Merge medio
- 3 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleworkspace/python-samples
-
ايقاف البحث الأمنQuizá libre de nuevo @sqrrrl la tomó hace 400 días y no hay ningún pull request abierto. Abierto
googleworkspace/python-samples#2434 · 1 asignado ·
-
Slow Uploads using Google Drive API with PythonQuizá libre de nuevo @sqrrrl la tomó hace 740 días y no hay ningún pull request abierto. Abierto
googleworkspace/python-samples#1852 · 1 comentario · 1 asignado ·
-
403 error from google after a few successful runs of my codeQuizá libre de nuevo @vinay-google la tomó hace 912 días y no hay ningún pull request abierto. Abierto
googleworkspace/python-samples#1424 · 1 asignado ·
-
How to see the progress of files which is getting uploadedQuizá libre de nuevo @vinay-google la tomó hace 928 días y no hay ningún pull request abierto. Abierto
googleworkspace/python-samples#1404 · 1 asignado ·
-
Phyton SamplesQuizá libre de nuevo @PierrickVoulet la tomó hace 975 días y no hay ningún pull request abierto. Abierto
googleworkspace/python-samples#1279 · 1 asignado ·
Todos los issues de googleworkspace/python-samples
Issues similares
-
[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 retryingPosiblemente ocupada @yipinghuang1991 la tomó hoy. Abiertocomp/agent P2 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NousResearch/hermes-agent#156837 ·
Los mantenedores suelen responder en 1 día
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yieldsPosiblemente ocupada @muskan-creates352 la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
fedora-infra/anitya#2188 ·
Los mantenedores suelen responder en 1 día
-
docs documentation need-triage SaaS
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
integration:hermes
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
vectorize-io/hindsight#6601 ·
Los mantenedores suelen responder en 1 día
-
triage:product type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
dbt-labs/dbt-adapters#2333 ·
Los mantenedores suelen responder en 1 día