Comments (2)
After careful review and consideration, I found that this represents something of a weakness in how JSON schemas had been modeled, essentially conflating "properties" and "types". I've changed this implementation to more naturally distinguish between types and properties, with a thorough description here: https://gitlab.com/meltano/singer-sdk/-/merge_requests/8
After updating to the latest (via poetry add singer-sdk==0.0.2-dev.1068744002
), please replace your sample code above with:
Property(
"Datasets",
ArrayType(
ObjectType(
Property("DatasetId", StringType),
Property("DatasetName", StringType),
)
)
The new convention (with formal Property
mapping) is demonstrated in this sample code from the MR (now with an added example of how to implement the nested ArrayType(ObjectType)
:
jsonschema = PropertiesList(
Property("id", IntegerType, required=True),
Property("name", StringType,
Property("tags", ArrayType(StringType)),
Property("ratio", NumberType),
Property("days_active", IntegerType),
Property("updated_on", DateTimeType),
Property("is_deleted", BooleanType,
Property(
"author",
ObjectType(
Property("id", StringType),
Property("name", StringType),
)
),
Property(
"groups",
ArrayType(
ObjectType(
Property("id", StringType),
Property("name", StringType),
)
)
),
The old syntax, wherein type definitions have names and the required flag, should still work for a little longer, but eventually I think it will probably make sense to move entirely to the new Property
syntax as shown above.
Also note that ComplexType
(which expected a name argument) is being replaced by ObjectTypes
(which does not accept a name argument).
Let me know if you have any difficulty implementing this spec or if you have any questions/concerns. I'm happy to lend a hand as needed.
from tap-powerbi-metadata.
I was able to solve this by converting to the new Property spec
from tap-powerbi-metadata.
Related Issues (15)
- All properties are set to required HOT 2
- key_properties in SCHEMA message is null when keys are defined in the Stream class HOT 4
- Continuation Token not properly parsed HOT 2
- Need design pattern for when API requires tight date range that needs to be iterated over HOT 6
- Test run with target-snowflake HOT 1
- Unknown type 'int' for validator with schema HOT 1
- Unknown type 'None' for validator with schema HOT 5
- Use of ComplexType results in "TypeError: 'bool' object is not iterable" HOT 3
- Code efficiency analysis HOT 2
- Clean up logging
- Clean up README
- Finish ActivityEventsStream PropertyList for commented out data points
- Refactor the TapPowerBIMetadata class PropertyList
- Add tap to pypi HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tap-powerbi-metadata.