# Refreshing physical datasets in external s3 source failing

**URL:** <https://community.dremio.com/t/refreshing-physical-datasets-in-external-s3-source-failing/8214>\
**Category:** Dremio University\
**Created:** [October 28, 2021, 1:57am UTC](https://community.dremio.com/t/refreshing-physical-datasets-in-external-s3-source-failing/8214 "2021-10-28T01:57:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abachu](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@abachu](https://community.dremio.com/u/abachu)\
**Post date:** [October 28, 2021, 1:57am UTC](https://community.dremio.com/t/refreshing-physical-datasets-in-external-s3-source-failing/8214/1 "2021-10-28T01:57:30Z")

</div>

I am trying to refresh metadata policy of physical datasets in external s3 sources in dremio using dremio\_client and its throwing me the following error

`DremioBadRequestException: Requested object does not exist on entity : 400 Client Error: Bad Request for url: https://dremio.whoop.com/api/v3/catalog_id`

I am using dremio simple client update\_catalog method to update the metadata policy of a PDS in s3

```auto
import dremio_client.dremio_simple_client as sc
import json

 payload = {
                "entityType": "dataset",
                "id": "dc0a1a67-aa5e-4c86-8c8f-8a7f245013cd",
                "path": ['dremios3', 'com.xxxx.dremio', 'metrics'],
                "type": "DATASET",
                "accelerationRefreshPolicy": {
                    "method": "FULL",
                    # "neverRefresh": True,
                    # "neverExpire": True,
                },
            }
    resp = sc.update_catalog(auth_token, _DREMIO_HOST, 'dc0a1a67-aa5e-4c86-8c8f-8a7f245013cd', json=json.dumps(payload))

```

This is the configuration I am using to update the metadata policy but not sure what am I doing wrong. Any help would be appreciated

---

<div class="post-metadata">

**Author:** ![balaji.ramaswamy](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/balaji.ramaswamy/32/843_2.png) [@balaji.ramaswamy](https://community.dremio.com/u/balaji.ramaswamy)\
**Post date:** [October 29, 2021, 6:00am UTC](https://community.dremio.com/t/refreshing-physical-datasets-in-external-s3-source-failing/8214/2 "2021-10-29T06:00:52Z")

</div>

@abachu The policy on a PDS is the reflection refresh schedule and not metadata refresh. To refresh metadata for a PDS you have to use the `ALTER PDS <PDS_NAME> REFRESH METADATA` SQL command

[https://docs.dremio.com/sql-reference/sql-commands/datasets/#refreshing-physical-dataset-metadata](https://docs.dremio.com/sql-reference/sql-commands/datasets/#refreshing-physical-dataset-metadata)
