简体   繁体   English

Boto3 Glue 客户端缺少 list_schemas() 方法 object

[英]list_schemas() method missing on Boto3 Glue client object

So, I think I'm running up against an issue with out of date documentation.所以,我认为我遇到了过时文档的问题。 According to the documentation here I should be able to use list_schemas() to get a list of schemas defined in the Hive Data Catalog: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/glue.html#Glue.Client.list_schemas根据此处的文档,我应该能够使用list_schemas()获取 Hive 数据目录中定义的模式列表: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/glue .html#Glue.Client.list_schemas

However, this method doesn't seem to exist:但是,这种方法似乎不存在:

import boto3

glue = boto3.client('glue')
glue.list_schemas()
AttributeError: 'Glue' object has no attribute 'list_schemas'

Other methods (eg list_crawlers() ) still appear to be present and work just fine.其他方法(例如list_crawlers() )似乎仍然存在并且工作得很好。 Has this method been moved?这个方法被移动了吗? Do I need to install some additional boto3 libraries for this to work?我需要安装一些额外的 boto3 库才能工作吗?

Based on the comments.根据评论。

The issue was caused by using old boto3 .该问题是由使用旧的 boto3引起的。 Upgrading to the newer version solved the issue.升级到较新版本解决了这个问题。

You should make a session first, and use the client method of the session, then it should work:你应该先制作一个session ,然后使用session的client方法,然后它应该可以工作:

import boto3
session = boto3.session.Session()
glue_client = session.client('glue')
schemas_name = glue_client.list_schemas()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 boto3 胶水 get_job_runs - 检查响应中是否存在特定日期的执行 object - boto3 glue get_job_runs - check execution with certain date exists in the response object Boto3 list_object_v2 非常慢 - Boto3 list_object_v2 painfully slow 如何使用 Boto3 库在 AWS Glue 中创建工作流程? - How to create a workflow in AWS Glue using Boto3 library? Python boto3 AWS Dynamodb 表“客户端”object 与“资源”object 上的查询和扫描方法 - Python boto3 AWS Dynamodb table Query & Scan methods on 'Client' object vs 'Resource' object Boto3 SES 客户端收到 SignatureDoesNotMatch 错误 - Boto3 SES Client gets SignatureDoesNotMatch error Boto3 在一个工作流程中创建不同类型的胶水触发器 - Boto3 create glue triggers with different types in one workflow 如何导入boto3 athena客户端异常 - how to import boto3 athena client exceptions boto3 `list_discovered_resources` 方法返回已删除的资源,即使标志 `includeDeletedResources` 设置为 False - The boto3 `list_discovered_resources` method is returning deleted resources even when flag `includeDeletedResources` is set to False Boto3 CloudFront Object 使用次数 - Boto3 CloudFront Object Usage Count 使用 Boto3 将 S3 object 作为字符串打开 - Open S3 object as a string with Boto3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM