frictionlessdata / tableschema-sql-py

Generate SQL tables, load and extract data, based on JSON Table Schema descriptors.
MIT License
61 stars 19 forks source link

Use JTSKit/json-table-schema-py instead of typecast #4

Closed pwalsh closed 8 years ago

pwalsh commented 9 years ago

I think it is better to use the type casting of JTSKit rather than the new typecast lib.

Why?

pudo commented 9 years ago

I guess it's your call since this lib exists on the okfn org, but I do intend to support as much of the JTS spec in typecast as appears reasonable. But if JTS is a rolling spec where the scope is defined by okfn's vendor libraries, you obviously win....

To be honest, the exact purpose and development path of jtskit have really confused me, which is why I didn't want to base any software on it. It seems to me to be a mix of JTS reference functions and half an implementation of messytables. I've also found that it doesn't work under Python 2, crashing with ASCII errors upon infer.

rufuspollock commented 9 years ago

@pudo can you open an issue for any bugs you have found with jtskit (or have you done so already)? They should definitely get fixed.

pudo commented 9 years ago

Yep, https://github.com/okfn/json-table-schema-py/issues/19

pwalsh commented 9 years ago

@pudo I know you have a penchant for rolling your own, but, why not help us get JTSKit in better shape rather than starting a new one?

I don't see the relationship to messytables - IMHO messytables is a real kitchen sink library that does lots of different things, and this is one of the reasons why a standalone json table schema lib exists - explicitly not to be tied to the rest of messytables.

pudo commented 9 years ago

Some clarification: I need typecast for jsonmapping, which does not use JTS (instead JSON Schema), and I'm hoping that it will be adopted by messytables so that the lib becomes less of a kitchen sink.

I really think that type casting is a piece of functionality that makes sense as a package, since it requires a good bit of complexity to get right (the code in typecast, which comes from messytables, has matured for four years now and there's still plenty to do).

There are other steps that should be taken to make messytables better, but let's discuss those in the other issue tracker. Still, given that messytables is a mature library which is adopted across OKFN's and other products, I would propose we don't give up on it easily and instead make it rock in the context of the JTS suite of tools!

pwalsh commented 9 years ago

Sure, as you suggested here, we can probably depend on typecast for parts of the JTS typecasting in JTSKit. But, because we'll always be following the JTS spec, and particularly the interplay between type + format there, then there remains a clear and strong usecase for "JTS-specific typecasting", in a way that probably should not be in messytables anyway, as far as I see. For the moment, what is called "JTS" in messytables barely reflects the current JTS spec.

pwalsh commented 9 years ago

Also @pudo if you have issues with the JTSKit API, please do open issues for them: bugs and design issues alike. Thanks.

rufuspollock commented 9 years ago

@pwalsh + @pudo one possibility is that messytables "v2" fully supports JTS. In that case messytables v2 would be "JTS infer" and we could depend on that.

Also for this current library (jts-sql) I think we could assume that typecasting has happened - we have the JTS already (?). In that case all we need is to use JTS + CSV to load into SQL. The question of how the JTS is generated can come from any of several JTS inference libraries (and we can work out asap which one to focus on). PS: I think i will try and create a diagram showing the various library parts and post in https://discuss.okfn.org/c/open-knowledge-labs/data-packages

pudo commented 9 years ago

+1 on messytables v2

rufuspollock commented 9 years ago

OK, here's the diagram and post: https://discuss.okfn.org/t/data-package-libraries-overview/957 - next thing to add is a list of the various implementations and how they fit together.

pwalsh commented 8 years ago

Closing in favour of https://github.com/okfn/jsontableschema-sql-py/issues/7

Also see https://github.com/okfn/jsontableschema-sql-py/issues/3#issuecomment-166253429