Object has no attribute 'get_all' when calling calendar.get_schedule.post()
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với cấu hình request và việc xử lý headers trong get_schedule_request_builder.py được tạo ra trong traceback, sau đó đọc kiota_abstractions/headers_collection.py, nơi get_all() được gọi. Kiểm tra loại header mà cấu hình request mong đợi và so sánh với dict được sử dụng trong ví dụ. Được xem là hoàn tất khi request được báo cáo không còn lỗi tại headers.add_all và hành vi header mong đợi đã được xác minh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I'm currently trying to get a room schedule through this code:
credential = ClientSecretCredential(
config['tenantID'],
config['clientID'],
config['clientSecret']
)
scopes = ['https://graph.microsoft.com/.default']
client = GraphServiceClient(credentials=credential, scopes=scopes)
# GET /users/{id | userPrincipalName}
async def get_rooms():
request_body = GetSchedulePostRequestBody(
schedules = [
"StanzaA@qq7h.onmicrosoft.com"
],
start_time = DateTimeTimeZone(
date_time = "2023-03-15T09:00:00",
time_zone = "Pacific Standard Time",
),
end_time = DateTimeTimeZone(
date_time = "2023-12-15T18:00:00",
time_zone = "Pacific Standard Time",
),
availability_view_interval = 60,
)
request_configuration = GetScheduleRequestBuilder.GetScheduleRequestBuilderPostRequestConfiguration(
headers = {
'Prefer' : "outlook.timezone=\"Pacific Standard Time\"",
}
)
result = await client.me.calendar.get_schedule.post(request_body, request_configuration = request_configuration)
if result:
print(result.value)
asyncio.run(get_rooms())
But when running I get an error coming from kiota
Traceback (most recent call last):
File "C:\Users\Massimo Mendozza\Documents\GitHub\DynamicsToJoan\main.py", line 52, in <module>
asyncio.run(get_rooms())
File "C:\Users\Massimo Mendozza\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\Massimo Mendozza\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Massimo Mendozza\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Massimo Mendozza\Documents\GitHub\DynamicsToJoan\main.py", line 46, in get_rooms
result = await client.me.calendar.get_schedule.post(request_body, request_configuration = request_configuration)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Massimo Mendozza\Documents\GitHub\DynamicsToJoan\Lib\site-packages\msgraph\generated\users\item\calendar\get_schedule\get_schedule_request_builder.py", line 40, in post
request_info = self.to_post_request_information(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Massimo Mendozza\Documents\GitHub\DynamicsToJoan\Lib\site-packages\msgraph\generated\users\item\calendar\get_schedule\get_schedule_request_builder.py", line 66, in to_post_request_information
request_info.headers.add_all(request_configuration.headers)
File "C:\Users\Massimo Mendozza\Documents\GitHub\DynamicsToJoan\Lib\site-packages\kiota_abstractions\headers_collection.py", line 83, in add_all
for key, values in headers.get_all().items():
^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'get_all'
I'm currently running under this pyvenv:
home = C:\Users\Massimo Mendozza\AppData\Local\Programs\Python\Python311
include-system-site-packages = false
version = 3.11.0
executable = C:\Users\Massimo Mendozza\AppData\Local\Programs\Python\Python311\python.exe
command = C:\Users\Massimo Mendozza\AppData\Local\Programs\Python\Python311\python.exe -m venv C:\Users\Massimo Mendozza\Documents\GitHub\DynamicsToJoan
And this are my packages version:
Package Version
------------------------------------ ---------
aiohttp 3.8.6
aiosignal 1.3.1
anyio 4.0.0
async-timeout 4.0.3
attrs 23.1.0
azure-core 1.29.5
azure-identity 1.15.0
certifi 2023.7.22
cffi 1.16.0
charset-normalizer 3.3.2
cryptography 41.0.5
Deprecated 1.2.14
frozenlist 1.4.0
h11 0.14.0
h2 4.1.0
hpack 4.0.0
httpcore 0.18.0
httpx 0.25.0
hyperframe 6.0.1
idna 3.4
importlib-metadata 6.8.0
microsoft-kiota-abstractions 1.0.0
microsoft-kiota-authentication-azure 1.0.0
microsoft-kiota-http 1.0.0
microsoft-kiota-serialization-json 1.0.0
microsoft-kiota-serialization-text 1.0.0
msal 1.24.1
msal-extensions 1.0.0
msgraph-core 1.0.0a4
msgraph-sdk 1.0.0
multidict 6.0.4
opentelemetry-api 1.20.0
opentelemetry-sdk 1.20.0
opentelemetry-semantic-conventions 0.41b0
pendulum 2.1.2
pip 22.3
portalocker 2.8.2
pycparser 2.21
PyJWT 2.8.0
python-dateutil 2.8.2
python-dotenv 1.0.0
pytzdata 2020.1
pywin32 306
requests 2.31.0
setuptools 65.5.0
six 1.16.0
sniffio 1.3.0
std-uritemplate 0.0.46
typing_extensions 4.8.0
urllib3 2.0.7
wrapt 1.15.0
yarl 1.9.2
zipp 3.17.0
- Ngôn ngữ chính
- Python
- Star
- 630
- Fork
- 96
- Merge trung bình
- 15 giờ 20 phút
- Pull request đã merge (30 ngày)
- 3
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoftgraph/msgraph-sdk-python
-
status:waiting-for-triage type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
-
status:waiting-for-triage type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoftgraph/msgraph-sdk-python#1563 ·
-
Needs: Attention :wave: type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoftgraph/msgraph-sdk-python#1287 · 2 bình luận · 1 reaction ·
-
Batch Request Support Đang mởstatus:waiting-for-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
microsoftgraph/msgraph-sdk-python#1557 ·
-
status:waiting-for-triage type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
microsoftgraph/msgraph-sdk-python#1556 · 1 bình luận · 1 reaction ·
Tất cả issue của microsoftgraph/msgraph-sdk-python
Issue tương tự
-
fix: inaccuracy ⚠️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
uabrc/uabrc.github.io#1255 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ethereum-optimism/factory#64 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
duckdb/duckdb-python#627 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Add link for tutorial Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Qiskit/qiskit-addon-sqd#376 ·