Why does passing a query to the q parameter to the list() function delete the file extension from the DRIVE API

import io
import os

from googleapiclient import discovery  # focuses on connecting to Google APIs
from httplib2 import Http  # provides an HTTP client for the app to use
from oauth2client import file, client, tools  # helps us manage OAuth2 credentials
import pandas as pd  # to make and manage as a dataframe

pd.set_option('display.max_columns', None)
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
from googleapiclient.http import MediaIoBaseDownload

SCOPES = 'https://www.googleapis.com/auth/drive.readonly'

store = file.Storage('storage.json')
creds = store.get()
if not creds or creds.invalid:
    flow = client.flow_from_clientsecrets('credentials.json', SCOPES)
    creds = tools.run_flow(flow, store)


def view_files(folder_id=""):
    if folder_id != "":
        query = f"parents = '{folder_id}'"
        files = DRIVE.files().list(pageSize=1000, q=query).execute().get('files', [])
        rows = []
        for f in files:
            rows.append(f)
        df = pd.DataFrame(rows)
        print(df.head(10))
        print(df["mimeType"].unique())
    else:
        files = DRIVE.files().list(pageSize=1000, q=None).execute().get('files', [])
        rows = []
        for f in files:
            rows.append(f)
        df = pd.DataFrame(rows)
        print(df.head(10))
        print(df["mimeType"].unique())

if __name__ == "__main__":
    view_files(folder_id="13JtdoGqcbsjebfFp")
    view_files()

The problem however, is, when I run the default code, the file names have their respective extensions in their filenames. But when I put the folder id, the filenames don’t have their extensions any more.
Why might that be? And how do I get the filenames with their respective extensions?

Attaching the output :

/Users/saatweek/PycharmProjects/replicate_gdrive/venv/bin/python /Users/saatweek/PycharmProjects/replicate_gdrive/trying_on_my_own.py 
         kind                              mimeType  
0  drive#file    application/vnd.google-apps.folder   
1  drive#file    application/vnd.google-apps.folder   
2  drive#file  application/vnd.google-apps.document   
3  drive#file  application/vnd.google-apps.document   
4  drive#file  application/vnd.google-apps.document   
5  drive#file  application/vnd.google-apps.document   

                                             id                      name  
0             1FKE2_nFjGrbj7oW4HbfkdGYGKb_6jxRz                     Notes  
1             1R1bdiCE7nlqk5aSKXUvadDnJEnhVWWH3                      Code  
2  1RiWVvd-onvy0eyGjvvkIA4G6hgYtA6bgfXD_fz_Sxd4   Brain Storming Strategy  
3  1X4XckEiFW_VpneiVlJRt6aqdvotojWN1Y-k3Xb_N28k  behera_satwik_wh3517_hw3  
4  18g6xs4NlFubpIiiGimfEbO6hiUSMaPu7DsRNHFYyhao  behera_satwik_wh3517_hw2  
5  1YffVnlHIJV-VuWZ-iCGVGM6tnFDeymvow7hBlCjQtqE          Project Proposal  
['application/vnd.google-apps.folder'
 'application/vnd.google-apps.document']
         kind                                           mimeType  
0  drive#file               application/vnd.google-apps.document   
1  drive#file  application/vnd.openxmlformats-officedocument....   
2  drive#file                                   application/json   
3  drive#file                                         image/jpeg   
4  drive#file                                         image/jpeg   
5  drive#file                                         image/jpeg   
6  drive#file                                         image/jpeg   
7  drive#file                                         image/jpeg   
8  drive#file                                         image/jpeg   
9  drive#file                                         image/jpeg   

                                             id                        name  
0  1pXFtguXmxqKhyq2CZyvqFU7zujvcqekiL68RfWqYDyo               Testing Notes  
1             1RGasEF6Pc7Bx-8Pl3HQupOcd0Z3357BY  Data for Gracie Tyler.xlsx  
2             1qzi5pcvuuRGKb3z6-MxA7rteijMiAXfJ  STAT_653_Lec_2_codes.ipynb  
3             1TFKX-5uU4zWPnCjCdcwCLDbH_DEeN15f                _MG_9120.jpg  
4             1lq2DrP1B4Ihye-YtPVf1xK31m1ggEJLT                _MG_9119.jpg  
5             1louaxNDzrFV-xqpIN6MgEcscemnj85Ax                _MG_9117.jpg  
6             15JqtlPwmtWLRRI88PenfS38h2oAd7em-                _MG_9118.jpg  
7             185I7Gh-DeNpfH3QF3S8A4eBl0DlYSYxU                _MG_9116.jpg  
8             1tr2tC83e3HqP06Ymfxw92sbd5wU2SqCE                _MG_9115.jpg  
9             1L_Z5HEF9VTU1ZC3-LiHcFJf7wdF67zGv                _MG_9114.jpg  
['application/vnd.google-apps.document'
 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
 'application/json' 'image/jpeg' 'video/quicktime'
 'application/vnd.google-apps.spreadsheet'
 'application/vnd.google-apps.presentation'
 'application/vnd.google-apps.folder'
 'application/vnd.google.colaboratory'
 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
 'image/heif' 'image/webp' 'video/mp4']

Process finished with exit code 0

I want a list of all the files in a particular folder (with all the details like file id, filename (with their extension), and all the folders present within that folder

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật