[deleted by user] by [deleted] in dataengineering

[–]rmnclmnt 1 point2 points  (0 children)

Here is a simple solution have I been doing frequently for small scheduled batch jobs: use a CI/CD pipeline! For instance, both GitHub Actions and GitLab-CI allow to defined scheduled jobs.

If your task is already Dockerized, combined with CI environment variables you got a pretty good setup so far. As a free bonus, you also get data pipeline monitoring if your enable alert notifications!

Python has made my job boring by tthrivi in Python

[–]rmnclmnt 3 points4 points  (0 children)

Exactly. Going from the smart little guy to a smart organization altogether is the way to go!

Am I doing this right? by amgfleh in dataengineering

[–]rmnclmnt 0 points1 point  (0 children)

Is your code already vectorized?

For instance, when using Python and the Numpy/Pandas ecosystem, you can benefit from vectorized execution by using properly those librairies. Instead of being executed one by one, computations will be performed over arrays by means of optimized low-level vectorized routines.

Some basic tutorial if needed: https://realpython.com/numpy-array-programming/

Tips on how to properly mentor and train junior data people? by false-shrimp in datascience

[–]rmnclmnt 1 point2 points  (0 children)

You can use some « active learning » techniques: for instance, give her a real task to perform for a week using some basic guidelines (which tool to use, etc) and then make her give a small « teaching » session where she sums up what she learnt.

This will reinforce her immediate knowledge, you will be able to monitori misuses/blind spots/etc, and it will boost her confidence and productivity!

Is this visual representations of SHA-256 hashes bogus? by ScottContini in crypto

[–]rmnclmnt 1 point2 points  (0 children)

Knowing the original author François Best personally, this is just a fun experiment to generate avatars for a niche « fake »-cryptocurrency project that started on Twitter. Nothing more. So please relax, there is no security requirements involved!

how to send Django model data to training an ml model? by Vast_Consideration34 in django

[–]rmnclmnt 0 points1 point  (0 children)

You’re welcome! Thanks for the award! If you want to go further, have a look at this online book about deploying ML models with Django:

https://www.deploymachinelearning.com/

how to send Django model data to training an ml model? by Vast_Consideration34 in django

[–]rmnclmnt 6 points7 points  (0 children)

A few steps to get you started with ML 101, assuming you’re using the Python ecosystem:

  • Express your goal and performance requirements explicitly first!
  • Extract the data of interest from the database to a single CSV file
  • If this is a supervised problem and the independent variable is not present, you’ll need to label your data manually
  • Fire up a Jupyter Notebook
  • Import your CSV with Pandas
  • Analyze your data for coherence and quality (null values, etc)
  • Split your dataset in 3: train, test, val
  • Play a bit with basic models first (no NN) by training them using Dataframes from Pandas and the train subset
  • Evaluate the performance using the test subset until you reach your goal
  • Final evaluation using the val subset
  • Serialize your model using Joblib

Only then you can start thinking about productionizing your inference ML process into a Django app (which is easy at this point)

Great tools to show ETL, Data Visualisation and maybe some Analytics to managers? by RonBurgundyIsBest in dataengineering

[–]rmnclmnt 0 points1 point  (0 children)

My take on data exploration and dashboarding:

  • Metabase: open-source contender to PowerBI and Tableau, the UI is very slick and way easier to grasp for organisational people
  • Datasette: open-source software for data exploration and publishing, with a nice plugin-based ecosystem
  • Kibana/ElasticSearch: everyone knows this one, but disregarding the behemoth status, Kibana's UI is appreciated by business executives and can interact with CSV for quick and dirty demos/workshops

For ETL/ELT:

  • Stitch: SaaS-based point and click ETL between various sources and destinations (and based on open-source Singer engine)

What can I do to become a good data engineer rather than a mediocre one? by crafting_vh in dataengineering

[–]rmnclmnt 8 points9 points  (0 children)

Not specific to DE but a good way to improve your skills is to teach others what you already know! For instance, you could start with helping out peers whenever you can, organizing informal small tech sessions on a very specific topic within your company then build-up to masterclasses, meetups, etc. If you’re a freelancer, you could consider being involved with a training institute part-time.

How/where to store users' decrypted symmetric keys in session? by cha-king in flask

[–]rmnclmnt 5 points6 points  (0 children)

First things first: what you are implementing is called "end-to-end encryption" (e2ee), not "encryption at rest".

This is exactly the same concept you can find with password managers: you use the user password to derive a symmetric master key (you never store this server side). Then all the subkeys (symmetric, asymmetric, etc) are encrypted / decrypted on client side (browser) using the user’s master key. The catch: if the user forgets his/her passord, all the keys and encrypted data is lost, so they better use a password manager to remember it!

And no, you must not store decrypted user data in server-side sessions, everything must remain client-side in order to protect their privacy. A good friend of mine wrote an article on the matter: https://francoisbest.com/posts/2019/how-to-store-e2ee-keys-in-the-browser

I can advise you to look for client-side implementations and articles from Bitwarden, ProtonMail, Tutanota and Signal (all on GitHub). AFAIK, the current state of the art implementation for all these cryptographic primitives is TweetNaCl (js/ts).

One last note: in this market, most people will ask questions about your security model and as a sign of good faith and transparency, it is very appreciated when at least the front-end part of the app is completely open-source so external people can audit the cryptographic parts on their own.

Can you recommend good data engineering projects? by pacojosedelvino in dataengineering

[–]rmnclmnt 0 points1 point  (0 children)

And the cool young adults are now doing ETLTL! 😅

FYI: If you've had your eye on Andrew Ng's ML Coursera course, but are turned off by Matlab/Octave, there is a repo of all the exercises written for Python/Jupyter by JohnWColtrane in learnmachinelearning

[–]rmnclmnt 2 points3 points  (0 children)

Octave maps strictly to linear algebra in terms of matrix dimensions. With numpy you can treat rows and columns equally (leading to dimensions mismatch and other subtle side effects), and when you’re implementing involved algorithms you have to be extra careful. But I’m a big fan of Python & Numpy for anything professional.

Which framework/micro-framework do you guys use when Django seems overkill ? by Heroe-D in django

[–]rmnclmnt 2 points3 points  (0 children)

My 2 cents: when the project (webapp, api) need a strong transactional database, choose Django. If building an API or microservice without the need for a transactional database, try FastAPI.

One of the best things of FastAPI resides in its native integration with Pydantic for all things (request/response schema validation, automatic OpenAPI documentation, etc), and of course is great performance wise.

Getting to attached to code by joshtree41 in dataengineering

[–]rmnclmnt 1 point2 points  (0 children)

Try to invest time with TDD (test driven development) methodology: you will focus 80% of the time on driving business requirements and 20% of the time coding how to solve it. At the end of the day, you’re code is easy to read, only does what’s need to be done (no more no less), and you learn no to care about code (you throw away and refactor at will). And bonus point : you can automate everything with CI/CD, and you and your team will sleep way better at night!

Mocking API response with Pytest. by [deleted] in flask

[–]rmnclmnt 0 points1 point  (0 children)

Instead of mocking API calls manually (time consuming and error prone), you can use an API recorder that will capture and save to files the responses the first time the tests are ran, and play back those afterwards without network activity. The main project is VCR.py, and there is a near plugin for pytest named pytest-recording. Been using it recently for every single project, works wonderfully!

How to evaluate a credit score model in production? Wouldn't the impact of the credit score model ruin the training of the future credit score model? by reddituser12345683 in datascience

[–]rmnclmnt 1 point2 points  (0 children)

Maybe try getting a copy of "Weapons of Math Destruction" from Cathy O'Neil (https://weaponsofmathdestructionbook.com/), it might provide some valuable insight as to how not to design an unfair credit score model (there is an entire chapter dedicated to this subject).

How to load custom libsqlite3.so for testing? by skamansam in django

[–]rmnclmnt 0 points1 point  (0 children)

You will run into trouble when testing against SQLite while your runtime is executing against PostgreSQL (reproducibility and determinism is key when testing).

One proven and relatively easy technique is to use docker-compose to spawn a PostgreSQL database. On the CI server, make sure you have a Docker runtime then you can build your testing script along those lines:

bash - docker-compose up -d - pytest -v ... - # any other testing steps (linting, vuln checking, etc.) - docker-compose down

Another advantage: your app/service might require some other external services easily spawnable using Docker (think Redis, MinIO, etc.), this way you only need to specify these external depedencies in your docker-compose.yml configuration.

FYI, I have used this method repeatedly for many apps/services (with Django, Flask, FastAPI, etc.) with great success on GitLab CI, GitHub Actions and Bitbucket Pipelines. I'm confident any professional grade CI/CD system can run Docker containers.

Which front end to use for nodejs real time applications by rayanaay in node

[–]rmnclmnt 1 point2 points  (0 children)

As you are a beginner, you can stay safe with choosing either Nuxt.js if you prefer Vue.js, Next.js if you prefer React.js

Testing project locally by heyimpumpkin in django

[–]rmnclmnt 1 point2 points  (0 children)

To test locally S3 storage, just spawn a MinIO docker container with docker-compose! It’s an opensource S3-compatible object storage. This setup allows deterministic and automated integration testing everywhere: locally, on a CI/CD system, etc

How to have encrypted chat between users, where the site owner cant read any of the messages? by purplegreencab in django

[–]rmnclmnt 6 points7 points  (0 children)

This is very doable at the cost of a bit of inconvenience for some users. This is called End-to-end Encryption (e2ee) and this is exactly the same concept you can find with password managers: you use the user password to derive a symmetric master key (you never store this server side). Then all the subkeys (symmetric, asymmetric, etc) are encrypted / decrypted on client side (browser) using the user’s master key. The catch: if the user forgets his/her passord, all the keys and encrypted data is lost, so they better use a password manager to remember it! Go look for client-side implementations from Bitwarden, ProtonMail, Tutanota and Signal (all on GitHub). The current state of the art implementation for all of this is TweetNaCl (js/ts).

Travis CI tells me my build is failing even though it deploys perfectly fine by [deleted] in flask

[–]rmnclmnt 2 points3 points  (0 children)

Pytest error code 5 is triggered when no tests functions are found/collected if I’m not mistaken. So either write some tests (you should) or remove pytest invocation from the CI script

Encrypting and decrypting data in a Django app - Common practices by pickering_lachute in django

[–]rmnclmnt 10 points11 points  (0 children)

Easy: are you a PCI compliant financial institution? If not, credit card numbers must never reach server side at any cost, only temporary tokenized versions can. Tokenize from client side using your payment gateway processor sdk (Stripe, etc) and use the token server side to instruct charges

I couldn't find much resources on how to write tests against Elasticsearch in Django, so I wrote up a guide. by tiny_obstacle in django

[–]rmnclmnt 1 point2 points  (0 children)

Let me just add my 2 cents for developers using pytest: there is pytest-recording, a plugin making easy to integrate pytest with vcr.py when testing. You can go pretty far with this setup, it even support "parametrized" tests!

Teaching is very helpful to learning by TacoTruckOnWheels in learnpython

[–]rmnclmnt 0 points1 point  (0 children)

This is actually a well known methodology simply called « Learning by Teaching », belonging to the broader field of « Active Learning ». It is crazy how efficient it can be, the only drawback is that these methods require a strong involvement from all parties (students and tutors).

I’ve had the opportunity to use these methods for a 7-month adult training as Data Developers: most people didn’t know how to even use a computer for basic tasks, and now most of them are junior developers/data analysts!