Title: get_metadata() drops the pii flag the API returns for each field · Issue #61 · brightdata/sdk-python · GitHub
Open Graph Title: get_metadata() drops the pii flag the API returns for each field · Issue #61 · brightdata/sdk-python
X Title: get_metadata() drops the pii flag the API returns for each field · Issue #61 · brightdata/sdk-python
Description: Summary get_metadata() discards the pii flag the API returns for each field. DatasetMetadata.from_dict builds every field as a DatasetField with four keys, type, active, required and description, and drops everything else. On datasets of...
Open Graph Description: Summary get_metadata() discards the pii flag the API returns for each field. DatasetMetadata.from_dict builds every field as a DatasetField with four keys, type, active, required and description, a...
X Description: Summary get_metadata() discards the pii flag the API returns for each field. DatasetMetadata.from_dict builds every field as a DatasetField with four keys, type, active, required and description, a...
Opengraph URL: https://github.com/brightdata/sdk-python/issues/61
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"get_metadata() drops the pii flag the API returns for each field","articleBody":"### Summary\n\n`get_metadata()` discards the `pii` flag the API returns for each field. `DatasetMetadata.from_dict` builds every field as a `DatasetField` with four keys, `type`, `active`, `required` and `description`, and drops everything else. On datasets of personal data, `pii` is the field a caller needs most.\n\n### Environment\n\n- `brightdata-sdk` 2.5.2 (latest on PyPI)\n- Python 3.12.13\n- Verified 18 Sep 2026\n\n### Reproduction\n\n```python\nfrom brightdata import SyncBrightDataClient\n\nwith SyncBrightDataClient(auto_create_zones=False) as c:\n fields = c.datasets.linkedin_profiles.get_metadata().fields\n\nprint([n for n, s in fields.items() if getattr(s, \"pii\", False)])\nprint(hasattr(next(iter(fields.values())), \"pii\"))\n```\n\n```\n[]\nFalse\n```\n\nThe same endpoint, read directly:\n\n```\nGET https://api.brightdata.com/datasets/gd_l1viktl72bvl7bjuj0/metadata\n```\n\n```\npii fields: ['id', 'name', 'about', 'url', 'input_url', 'linkedin_id', 'first_name', 'last_name']\n```\n\n### Why it happens\n\n`datasets/models.py`, `DatasetMetadata.from_dict`:\n\n```python\nfields[name] = DatasetField(\n type=field_data.get(\"type\", \"text\"),\n active=field_data.get(\"active\", True),\n required=field_data.get(\"required\", False),\n description=field_data.get(\"description\"),\n)\n```\n\n`pii` is never read. Neither are `normalize` and `validation_rules`, which the API also returns.\n\n### Why it matters\n\nA caller building a data-retention policy, a redaction step, or a field allowlist would reasonably read `pii` from the schema instead of hard-coding a list. Through the SDK they get no field marked, which reads as \"no personal data here\" on a dataset of people.\n\nThe JavaScript SDK passes the raw field object through, so the flag survives there. The two SDKs disagree on the same endpoint.\n\n### Expected\n\nAdd `pii: bool = False` to `DatasetField` and read it in `from_dict`. Keeping the raw dict on the model, for keys the SDK does not model yet, would stop the next new key being dropped the same way.\n","author":{"url":"https://github.com/anil-bd","@type":"Person","name":"anil-bd"},"datePublished":"2026-09-18T14:03:33Z","url":"https://github.com/brightdata/sdk-python/issues/61"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:90215923-a1f8-e385-8817-35d677a1488f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99CE:1F98:1730EFE:1E79B8A:6B040CB5 |
| html-safe-nonce | dd7e2f199618b4a1ffa292b83c0c8495f3f8be1a3d434df391a7e680ed9dd0e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUNFOjFGOTg6MTczMEVGRToxRTc5QjhBOjZCMDQwQ0I1IiwidmlzaXRvcl9pZCI6IjI4OTM4ODg3MjAzMzM5NjY1MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | adbc1d715c0a0b1ada3845ec62853b9bcabf310ea54063834c32924db1c5aec6 |
| hovercard-subject-tag | issue:5500489121 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/brightdata/sdk-python/61/issue_layout |
| twitter:image | https://opengraph.githubassets.com/22700077e82a9d4edca8f31d2631ece822ff4e9d0abac6354ecf87ad8b813b41/brightdata/sdk-python/issues/61 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/22700077e82a9d4edca8f31d2631ece822ff4e9d0abac6354ecf87ad8b813b41/brightdata/sdk-python/issues/61 |
| og:image:alt | Summary get_metadata() discards the pii flag the API returns for each field. DatasetMetadata.from_dict builds every field as a DatasetField with four keys, type, active, required and description, a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anil-bd |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/brightdata/sdk-python git https://github.com/brightdata/sdk-python.git |
| octolytics-dimension-user_id | 213028976 |
| octolytics-dimension-user_login | brightdata |
| octolytics-dimension-repository_id | 1033685757 |
| octolytics-dimension-repository_nwo | brightdata/sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1033685757 |
| octolytics-dimension-repository_network_root_nwo | brightdata/sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width